Encoding motion vectors for geometric motion partitioning

ABSTRACT

In one example, an apparatus includes a video encoder configured to partition a block of video data into a first partition and a second partition using a geometric motion partition line, determine a first motion vector for the first partition and a second motion vector for the second partition, encode the first motion vector based on a first motion predictor selected from motion vectors for blocks neighboring the first partition, encode the second motion vector based on a second motion predictor selected from motion vectors for blocks neighboring the second partition, wherein the blocks neighboring the second partition are determined independently of the blocks neighboring the first partition, and output the encoded first and second motion vectors. A video decoder may similarly decode the motion vectors based on determining the first and second motion predictors for the first and second partitions.

This application claims the benefit of U.S. Provisional Application No.61/305,892, filed Feb. 18, 2010, U.S. Provisional Application No.61/323,233, filed Apr. 12, 2010, and U.S. Provisional Application No.61/323,244, filed Apr. 12, 2010, the entire content of each of which isexpressly incorporated by reference herein.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application for patent is related to the followingco-pending U.S. patent application: “SMOOTHING OVERLAPPED REGIONSRESULTING FROM GEOMETRIC MOTION PARTITIONING” by Chen et al., havingAttorney Docket No. 101050U1, filed concurrently herewith, assigned tothe assignee hereof, and expressly incorporated by reference herein;“ADAPTIVE TRANSFORM SIZE SELECTION FOR GEOMETRIC MOTION PARTITIONING” byChen et al., having Attorney Docket No. 101050U2, filed concurrentlyherewith, assigned to the assignee hereof, and expressly incorporated byreference herein; and “FIXED POINT IMPLEMENTATION FOR GEOMETRIC MOTIONPARTITIONING” by Joshi et al., having Attorney Docket No. 101637, filedconcurrently herewith, assigned to the assignee hereof, and expresslyincorporated by reference herein.

TECHNICAL FIELD

This disclosure relates to video coding.

BACKGROUND

Digital video capabilities can be incorporated into a wide range ofdevices, including digital televisions, digital direct broadcastsystems, wireless broadcast systems, personal digital assistants (PDAs),laptop or desktop computers, digital cameras, digital recording devices,digital media players, video gaming devices, video game consoles,cellular or satellite radio telephones, video teleconferencing devices,and the like. Digital video devices implement video compressiontechniques, such as those described in the standards defined by MPEG-2,MPEG-4, ITU-T H.263 or ITU-T H.264/MPEG-4, Part 10, Advanced VideoCoding (AVC), and extensions of such standards, to transmit and receivedigital video information more efficiently.

Video compression techniques perform spatial prediction and/or temporalprediction to reduce or remove redundancy inherent in video sequences.For block-based video coding, a video frame or slice may be partitionedinto macroblocks. Each macroblock can be further partitioned.Macroblocks in an intra-coded (I) frame or slice are encoded usingspatial prediction with respect to neighboring macroblocks. Macroblocksin an inter-coded (P or B) frame or slice may use spatial predictionwith respect to neighboring macroblocks in the same frame or slice ortemporal prediction with respect to other reference frames.

SUMMARY

In general, this disclosure describes techniques for supportinggeometric motion partitioning of video blocks. That is, rather thanpartitioning a rectangular block into two or more strictly rectangularpartitions, the techniques of this disclosure provide for partitioningthe block using an arbitrary partition boundary, referred to asgeometric motion partitioning. To support geometric motion partitioning,this disclosure provides techniques for performing motion compensationfor overlapping portions of the partitions at the partition boundary.This disclosure also provides techniques for adaptively selecting atransform size for sub-blocks of the partitioned block. Furthermore,this disclosure provides techniques for individually encoding motionvectors of the partitions. Moreover, the techniques of this disclosuremay be performed using either fixed point or floating pointimplementations.

In one example, a method includes partitioning a block of video datainto a first partition and a second partition using a geometric motionpartition line, calculating a prediction value of a pixel in atransition region of the block using a filter that applies a value forat least one neighboring pixel from the first partition and a value forat least one neighboring pixel from the second partition, calculating aresidual value of the pixel in the transition region of the block basedon the prediction value of the pixel in the transition region, andoutputting the residual value of the pixel.

In another example, an apparatus includes a video encoder configured topartition a block of video data into a first partition and a secondpartition using a geometric motion partition line, calculate aprediction value of a pixel in a transition region of the block using afilter that applies a value for at least one neighboring pixel from thefirst partition and a value for at least one neighboring pixel from thesecond partition, calculate a residual value of the pixel in thetransition region of the block based on the prediction value of thepixel in the transition region, and output the residual value of thepixel.

In another example, an apparatus includes means for partitioning a blockof video data into a first partition and a second partition using ageometric motion partition line, means for calculating a predictionvalue of a pixel in a transition region of the block using a filter thatapplies a value for at least one neighboring pixel from the firstpartition and a value for at least one neighboring pixel from the secondpartition, means for calculating a residual value of the pixel in thetransition region of the block based on the prediction value of thepixel in the transition region, and means for outputting the residualvalue of the pixel.

In another example, a computer program product comprises a computerreadable medium having stored thereon instructions that, when executed,cause a processor to partition a block of video data into a firstpartition and a second partition using a geometric motion partitionline, calculate a prediction value of a pixel in a transition region ofthe block using a filter that applies a value for at least oneneighboring pixel from the first partition and a value for at least oneneighboring pixel from the second partition, calculate a residual valueof the pixel in the transition region of the block based on theprediction value of the pixel in the transition region, and output theresidual value of the pixel.

In another example, a method includes receiving an encoded block ofvideo data, a definition of a geometric motion partition line thatpartitions the encoded block into a first partition and a secondpartition, and a residual value for a pixel in a transition region ofthe block, calculating a prediction value of the pixel in the transitionregion of the block using a filter that applies a value for at least oneneighboring pixel from the first partition and a value for at least oneneighboring pixel from the second partition, calculating a reconstructedvalue for the pixel in the transition region of the block based on theprediction value and the residual value, and outputting thereconstructed value of the pixel.

In another example, an apparatus includes a video decoder configured toreceive an encoded block of video data, a definition of a geometricmotion partition line that partitions the encoded block into a firstpartition and a second partition, and a residual value for a pixel in atransition region of the block, calculate a prediction value of thepixel in the transition region of the block using a filter that appliesa value for at least one neighboring pixel from the first partition anda value for at least one neighboring pixel from the second partition,calculate a reconstructed value for the pixel in the transition regionof the block based on the prediction value and the residual value, andoutput the reconstructed value of the pixel.

In another example, an apparatus includes means for receiving an encodedblock of video data, a definition of a geometric motion partition linethat partitions the encoded block into a first partition and a secondpartition, and a residual value for a pixel in a transition region ofthe block, means for calculating a prediction value of the pixel in thetransition region of the block using a filter that applies a value forat least one neighboring pixel from the first partition and a value forat least one neighboring pixel from the second partition, means forcalculating a reconstructed value for the pixel in the transition regionof the block based on the prediction value and the residual value, andmeans for outputting the reconstructed value of the pixel.

In another example, a computer program product comprises a computerreadable medium having stored thereon instructions that, when executed,cause a processor to receive an encoded block of video data, adefinition of a geometric motion partition line that partitions theencoded block into a first partition and a second partition, and aresidual value for a pixel in a transition region of the block,calculate a prediction value of the pixel in the transition region ofthe block using a filter that applies a value for at least oneneighboring pixel from the first partition and a value for at least oneneighboring pixel from the second partition, calculate a reconstructedvalue for the pixel in the transition region of the block based on theprediction value and the residual value, and output the reconstructedvalue of the pixel.

In another example, a method includes partitioning a block of video datainto a first geometric partition and a second geometric partition usinga geometric motion partition line, wherein the block comprises N×Npixels, dividing the block of video data into four equally-sized,non-overlapping (N/2)×(N/2) sub-blocks, and encoding at least one of thesub-blocks through which the geometric motion partition line passesusing a transform size smaller than (N/2)×(N/2).

In another example, an apparatus includes a video encoder configured topartition a block of video data into a first geometric partition and asecond geometric partition using a geometric motion partition line,wherein the block comprises N×N pixels, divide the block of video datainto four equally-sized, non-overlapping (N/2)×(N/2) sub-blocks, andencode at least one of the sub-blocks through which the geometric motionpartition line passes using a transform size smaller than (N/2)×(N/2).

In another example, an apparatus includes means for partitioning a blockof video data into a first geometric partition and a second geometricpartition using a geometric motion partition line, wherein the blockcomprises N×N pixels, means for dividing the block of video data intofour equally-sized, non-overlapping (N/2)×(N/2) sub-blocks, and meansfor encoding at least one of the sub-blocks through which the geometricmotion partition line passes using a transform size smaller than(N/2)×(N/2).

In another example, a computer program product comprises a computerreadable medium having stored thereon instructions that, when executed,cause a processor to partition a block of video data into a firstgeometric partition and a second geometric partition using a geometricmotion partition line, wherein the block comprises N×N pixels, dividethe block of video data into four equally-sized, non-overlapping(N/2)×(N/2) sub-blocks, and encode at least one of the sub-blocksthrough which the geometric motion partition line passes using atransform size smaller than (N/2)×(N/2).

In another example, a method includes receiving an encoded block ofvideo data partitioned into a first geometric partition and a secondgeometric partition by a geometric motion partition line, wherein theblock comprises N×N pixels, dividing the block of video data into fourequally-sized, non-overlapping (N/2)×(N/2) sub-blocks, and inversetransforming at least one of the sub-blocks through which the geometricmotion partition line passes using a transform size smaller than(N/2)×(N/2).

In another example, an apparatus includes a video decoder configured toreceive an encoded block of video data partitioned into a firstgeometric partition and a second geometric partition by a geometricmotion partition line, wherein the block comprises N×N pixels, dividethe block of video data into four equally-sized, non-overlapping(N/2)×(N/2) sub-blocks, and inverse transform at least one of thesub-blocks through which the geometric motion partition line passesusing a transform size smaller than (N/2)×(N/2).

In another example, an apparatus includes means for receiving an encodedblock of video data partitioned into a first geometric partition and asecond geometric partition by a geometric motion partition line, whereinthe block comprises N×N pixels, means for dividing the block of videodata into four equally-sized, non-overlapping (N/2)×(N/2) sub-blocks,and means for inverse transforming at least one of the sub-blocksthrough which the geometric motion partition line passes using atransform size smaller than (N/2)×(N/2).

In another example, a computer program product comprises a computerreadable medium having stored thereon instructions that, when executed,cause a processor to receive an encoded block of video data partitionedinto a first geometric partition and a second geometric partition by ageometric motion partition line, wherein the block comprises N×N pixels,divide the block of video data into four equally-sized, non-overlapping(N/2)×(N/2) sub-blocks, and inverse transform at least one of thesub-blocks through which the geometric motion partition line passesusing a transform size smaller than (N/2)×(N/2).

In another example, a method includes partitioning a block of video datainto a first partition and a second partition using a geometric motionpartition line, determining a first motion vector for the firstpartition and a second motion vector for the second partition, encodingthe first motion vector based on a first motion predictor selected frommotion vectors for blocks neighboring the first partition, encoding thesecond motion vector based on a second motion predictor selected frommotion vectors for blocks neighboring the second partition, wherein theblocks neighboring the second partition are determined independently ofthe blocks neighboring the first partition, and outputting the encodedfirst and second motion vectors.

In another example, an apparatus includes a video encoder configured topartition a block of video data into a first partition and a secondpartition using a geometric motion partition line, determine a firstmotion vector for the first partition and a second motion vector for thesecond partition, encode the first motion vector based on a first motionpredictor selected from motion vectors for blocks neighboring the firstpartition, encode the second motion vector based on a second motionpredictor selected from motion vectors for blocks neighboring the secondpartition, wherein the blocks neighboring the second partition aredetermined independently of the blocks neighboring the first partition,and output the encoded first and second motion vectors.

In another example, an apparatus includes means for partitioning a blockof video data into a first partition and a second partition using ageometric motion partition line, means for determining a first motionvector for the first partition and a second motion vector for the secondpartition, means for encoding the first motion vector based on a firstmotion predictor selected from motion vectors for blocks neighboring thefirst partition, means for encoding the second motion vector based on asecond motion predictor selected from motion vectors for blocksneighboring the second partition, wherein the blocks neighboring thesecond partition are determined independently of the blocks neighboringthe first partition, and means for outputting the encoded first andsecond motion vectors.

In another example, a computer program product comprises a computerreadable medium having stored thereon instructions that, when executed,cause a processor to determine a set of blocks that neighbor thepartitioned block, determine a first subset of the set of blockscomprising blocks that neighbor the first partition, and determine asecond subset of the set of blocks comprising blocks that neighbor thesecond partition, independently of determining the first subset.

In another example, a method includes receiving a block of video datapartitioned by a geometric motion partition line into a first partitionand a second partition, a first encoded motion vector for the firstpartition, and a second encoded motion vector for the second partition,decoding the first encoded motion vector based on a first motionpredictor selected from motion vectors for blocks neighboring the firstpartition, decoding the second encoded motion vector based on a secondmotion predictor selected from motion vectors for blocks neighboring thesecond partition, wherein the blocks neighboring the second partitionare determined independently of the blocks neighboring the firstpartition, and decoding the block using the decoded first and secondmotion vectors.

In another example, an apparatus includes a video decoder configured toreceive a block of video data partitioned by a geometric motionpartition line into a first partition and a second partition, a firstencoded motion vector for the first partition, and a second encodedmotion vector for the second partition, decode the first encoded motionvector based on a first motion predictor selected from motion vectorsfor blocks neighboring the first partition, decode the second encodedmotion vector based on a second motion predictor selected from motionvectors for blocks neighboring the second partition, wherein the blocksneighboring the second partition are determined independently of theblocks neighboring the first partition, and decode the block using thedecoded first and second motion vectors.

In another example, an apparatus includes means for receiving a block ofvideo data partitioned by a geometric motion partition line into a firstpartition and a second partition, a first encoded motion vector for thefirst partition, and a second encoded motion vector for the secondpartition, means for decoding the first encoded motion vector based on afirst motion predictor selected from motion vectors for blocksneighboring the first partition, means for decoding the second encodedmotion vector based on a second motion predictor selected from motionvectors for blocks neighboring the second partition, wherein the blocksneighboring the second partition are determined independently of theblocks neighboring the first partition, and means for decoding the blockusing the decoded first and second motion vectors.

In another example, a computer program product comprises a computerreadable medium having stored thereon instructions that, when executed,cause a processor to receive a block of video data partitioned by ageometric motion partition line into a first partition and a secondpartition, a first encoded motion vector for the first partition, and asecond encoded motion vector for the second partition, decode the firstencoded motion vector based on a first motion predictor selected frommotion vectors for blocks neighboring the first partition, decode thesecond encoded motion vector based on a second motion predictor selectedfrom motion vectors for blocks neighboring the second partition, whereinthe blocks neighboring the second partition are determined independentlyof the blocks neighboring the first partition, and decode the blockusing the decoded first and second motion vectors.

In another example, a method includes partitioning a block of video datainto a first partition and a second partition using a geometric motionpartition line, calculating a slope value and a y-intercept value of thegeometric motion partition line, wherein the slope value and they-intercept value comprise integer values, calculating a mask indicativeof pixels of the block in the first partition and pixels of the block inthe second partition, encoding the first partition and the secondpartition based on the mask, and outputting the encoded first partition,the encoded second partition, the slope value, and the y-interceptvalue.

In another example, an apparatus includes a video encoder configured topartition a block of video data into a first partition and a secondpartition using a geometric motion partition line, calculate a slopevalue and a y-intercept value of the geometric motion partition line,wherein the slope value and the y-intercept value comprise integervalues, calculate a mask indicative of pixels of the block in the firstpartition and pixels of the block in the second partition, encode thefirst partition and the second partition based on the mask, and outputthe encoded first partition, the encoded second partition, the slopevalue, and the y-intercept value.

In another example, an apparatus includes means for partitioning a blockof video data into a first partition and a second partition using ageometric motion partition line, means for calculating a slope value anda y-intercept value of the geometric motion partition line, wherein theslope value and the y-intercept value comprise integer values, means forcalculating a mask indicative of pixels of the block in the firstpartition and pixels of the block in the second partition, means forencoding the first partition and the second partition based on the mask,and means for outputting the encoded first partition, the encoded secondpartition, the slope value, and the y-intercept value.

In another example, a computer program product comprises a computerreadable medium having stored thereon instructions that, when executed,cause a processor to partition a block of video data into a firstpartition and a second partition using a geometric motion partitionline, calculate a slope value and a y-intercept value of the geometricmotion partition line, wherein the slope value and the y-intercept valuecomprise integer values, calculate a mask indicative of pixels of theblock in the first partition and pixels of the block in the secondpartition, encode the first partition and the second partition based onthe mask, and output the encoded first partition, the encoded secondpartition, the slope value, and the y-intercept value.

In another example, a method includes receiving an encoded block ofvideo data that has been partitioned into a first partition and a secondpartition by a geometric motion partition line, receiving a slope valueand a y-intercept value defining the geometric motion partition line,wherein the slope value and the y-intercept value comprise integervalues, calculating a mask indicative of pixels of the block in thefirst partition and pixels of the block in the second partition,decoding the first partition and the second partition of the block basedon the mask, and outputting the decoded block.

In another example, an apparatus includes a video decoder configured toreceive an encoded block of video data that has been partitioned into afirst partition and a second partition by a geometric motion partitionline, receive a slope value and a y-intercept value defining thegeometric motion partition line, wherein the slope value and they-intercept value comprise integer values, calculate a mask indicativeof pixels of the block in the first partition and pixels of the block inthe second partition, decode the first partition and the secondpartition of the block based on the mask, and output the decoded block.

In another example, an apparatus includes means for receiving an encodedblock of video data that has been partitioned into a first partition anda second partition by a geometric motion partition line, means forreceiving a slope value and a y-intercept value defining the geometricmotion partition line, wherein the slope value and the y-intercept valuecomprise integer values, means for calculating a mask indicative ofpixels of the block in the first partition and pixels of the block inthe second partition, means for decoding the first partition and thesecond partition of the block based on the mask, and means foroutputting the decoded block.

In another example, a computer program product comprises a computerreadable medium having stored thereon instructions that, when executed,cause a processor to receive an encoded block of video data that hasbeen partitioned into a first partition and a second partition by ageometric motion partition line, receive a slope value and a y-interceptvalue defining the geometric motion partition line, wherein the slopevalue and the y-intercept value comprise integer values, calculate amask indicative of pixels of the block in the first partition and pixelsof the block in the second partition, decode the first partition and thesecond partition of the block based on the mask, and output the decodedblock.

The details of one or more examples are set forth in the accompanyingdrawings and the description below. Other features, objects, andadvantages will be apparent from the description and drawings, and fromthe claims.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating an example video encoding anddecoding system that may utilize techniques for geometric motionpartitioning.

FIG. 2 is a block diagram illustrating an example of video encoder thatmay implement techniques for geometric motion partitioning.

FIG. 3 is a block diagram illustrating an example of video decoder thatmay decode an encoded video sequence including geometric motionpartitioned blocks.

FIG. 4 is a conceptual diagram illustrating a block that has beenpartitioned using a geometric motion partition line and parameters usedto define the geometric motion partition line.

FIG. 5 is a conceptual diagram illustrating a block that has beenpartitioned using a geometric motion partition line and pixels in atransition region near the geometric motion partition line.

FIG. 6 is a conceptual diagram illustrating a 3×3 pixel array.

FIG. 7 is a flowchart illustrating an example method for performingsmoothing when calculating a residual value for a block partitioned witha geometric motion partition line.

FIG. 8 is a conceptual diagram illustrating an example block to betransformed using adaptive transform size selection.

FIG. 9 is a conceptual diagram of another example block to betransformed using adaptive transform size selection.

FIG. 10 is a flowchart illustrating an example method for determiningtransform sizes for sub-blocks of an N×N block.

FIG. 11 is a block diagram illustrating a geometry partitioned block andneighboring sub-blocks.

FIG. 12 is a flowchart illustrating an example method for encodingmotion vectors of geometric motion partitions of a block of video data.

FIG. 13 is a flowchart illustrating an example method for encoding ablock of video data using a fixed point implementation.

DETAILED DESCRIPTION

In general, this disclosure describes techniques for supportinggeometric motion partitioning of video blocks. That is, rather thanpartitioning a rectangular block into two or more strictly rectangularpartitions, the techniques of this disclosure provide for partitioningthe block using an arbitrary partition boundary, referred to asgeometric motion partitioning. The partition line may be defined usingtwo parameters: the length ρ (rho) of the line segment perpendicular tothe partition line and originating at the center point of thepartitioned block, and the angle of the perpendicular line relative to ahorizontal line passing through the center point of the partitionedblock θ (theta). In some examples, the partition line may be realized bya stepped line that demarcates pixels of each partition, such that thepartition line does not pass through any pixels of the block.

For purposes of example and explanation, this disclosure describestechniques for geometric motion partitioning of a macroblock. It shouldbe understood, however, that these techniques may generally be appliedto partition any block of video data. The term macroblock refers to adata structure for coding digital picture and video data using atwo-dimensional pixel array, typically having a size of 16×16 pixels. Amacroblock may include chrominance data and luminance data. Typically,the chrominance data is downsampled relative to the luminance data by afactor of two, horizontally and vertically. Thus, a macroblock mayinclude four luminance blocks and two chrominance blocks. Each of thefour luminance blocks may comprise 8×8 pixels, and each corner of themacroblock may be touched by the corner of exactly one of the luminanceblocks. The two chrominance blocks may be 8×8 pixel blocks such that thecorners of each of the chrominance blocks touch the respective cornersof the macroblock. Thus, the chrominance blocks may overlap each otherand the luminance blocks.

Video coding standards typically provide various prediction modes forencoding a block of video data. Intra-prediction involves encoding ablock of a slice or frame relative to other blocks of the same slice orframe. Inter-prediction allows for encoding a block of a slice or framerelative to one or more other slices or frames, using motion estimationand motion compensation techniques.

The techniques of this disclosure, which are generally directed togeometric motion partitioning, may allow arbitrary partition sizes andshapes. That is, a partition line defined using the rho and theta valuesdescribed above may allow non-rectangular partitions to be used toencode a macroblock. In particular, the techniques of this disclosuredescribe techniques for producing motion vectors for the geometricmotion partitions, and for performing motion compensation based on thegeometric motion partitions. A geometric motion partition line is notlimited to partitioning a block into rectangular partitions. While insome examples a geometric motion partition line may partition an N×Nblock into an N×M block, geometric motion partitioning also offers theability to partition a block into non-rectangular partitions such as,e.g., a triangular partition. In this manner, a geometric motionpartition line may intersect one horizontal boundary of a block and onevertical boundary of the block.

In some examples, supporting geometric motion partitioning includes theuse of modified motion compensation techniques. In particular, themodified motion compensation techniques may provide a smoothing filterfor pixels in a transition region near the geometric motion partitionline. The motion compensation techniques of this disclosure may includedetermining residual values for such overlapping pixels. In one example,the techniques of this disclosure define a low-pass filter (e.g., asmoothing filter) to perform motion compensation in this boundaryregion. That is, various filters may be defined that smooth thetransition between the partitions at the geometry partition line. If apixel falls within the transition region, motion compensation for thatpixel may be performed by applying one of these filters to determine aprediction value for the pixel, where the filter applies values fromprediction blocks identified by motion vectors for the partitions, andthen determining the difference between the prediction value and thevalue of the pixel to be encoded. This difference may represent theresidual value for the pixel.

In another example, to perform motion compensation at the boundaryregion of a geometrically partitioned block, a weighted average may beused. That is, to determine the motion compensated value for a pixel, aweighted average of the values for the pixel from the two partitions maybe calculated. The value for the partition to which the pixel isrelatively closer may be weighted more heavily than the value for theother partition. The predicted value for a pixel may be calculated inthis manner, then used to calculate a residual value, or to reconstructan encoded block by applying a received residual value to the predictedvalue.

This disclosure also includes techniques for encoding a residual of ablock partitioned using a geometric motion partition. To encode theresidual of a block with a geometric partition, an adaptive transformsize may be used, based on the position of the partition line. Ingeneral, for each sub-block block of N×N pixels, the residual for thesub-block may be encoded using an N×N transform size if the partitiondoes not cross through the block; otherwise, the N×N sub-block may besub-divided into N/2×N/2 sub-blocks, each of which may be re-analyzed asto whether the partition line crosses through the sub-blocks.

For example, suppose the block size is 16×16. For each 8×8 sub-blockinside, an 8×8 transform may be used if all pixels inside the 8×8 blockbelong to the same partition, otherwise four 4×4 transforms may be used.As another example, when the block size is 32×32 or 64×64, for each32×32 or 16×16 inner sub-block, a 16×16 transform may be used if allpixels inside the 16×16 block belong to the same partition, otherwisethe logic may be repeated for each 16×16 sub-block.

This disclosure further provides techniques for encoding motion vectorsfor partitions of a block partitioned using a geometric motion partitionline. These techniques may include selecting motion predictors for themotion vectors, and the candidates for the motion predictors may bedifferent for the motion vectors of two partitions of the same block.The candidates for the motion predictors may also include more potentialmotion predictors than those for conventional encoding standards.

The techniques of this disclosure can also be applied in a fixed pointimplementation. In particular, the geometric motion partition line canbe defined using fixed point (e.g., integer) values representative of aslope (m) and a y-intercept (c) of the line. An encoder and a decodermay each be configured to use fixed point arithmetic to evaluate ageometric motion partition, such that the encoder and the decoder createidentical masks from the fixed point values. The encoder and decoder maybe configured to calculate the mask as follows: for each point (x, y) ofthe mask, the value of the point at (x, y) in the mask is 1 if y−m*x<c,and the value of the point at (x, y) in the mask is 0 if y−m*x>=c. Inthis manner, the encoder and decoder may be configured to calculate themask (comprising a set of points defined by respective x-values andy-values) such that, for each point in the mask, the value of the pointin the mask is set to a value indicative of whether the differencebetween the y-value of the point and the product of the slope value ofthe line and the x-value of the point is greater than the y-interceptvalue of the line. The value of each point in the mask may comprise aone-bit value.

Points in the mask having a value of 0 correspond to region zero, whilepoints in the mask having a value of 1 correspond to region one. Regionzero may be one partition and region one may be another partition, asdefined by the geometric motion partition. Thus, rather than calculatingmasks from the angle θ (theta) and distance ρ (rho) to the center pointof the geometric motion partition using floating point arithmetic, theencoder and decoder may be configured to calculate the masks using fixedpoint, integer values for slope m and y-intercept c based on the angleand center point values. The techniques of this disclosure also mayinclude signaling whether geometric motion partitioning is used for aparticular block or set of blocks, and if so, whether fixed point orfloating point operations are to be used for the block or set of blocks.

FIG. 1 is a block diagram illustrating an example video encoding anddecoding system 10 that may utilize techniques for geometric motionpartitioning. As shown in FIG. 1, system 10 includes a source device 12that transmits encoded video to a destination device 14 via acommunication channel 16. Source device 12 and destination device 14 maycomprise any of a wide range of devices. In some cases, source device 12and destination device 14 may comprise wireless communication devices,such as wireless handsets, so-called cellular or satelliteradiotelephones, or any wireless devices that can communicate videoinformation over a communication channel 16, in which case communicationchannel 16 is wireless. The techniques of this disclosure, however,which concern geometric motion partitioning, are not necessarily limitedto wireless applications or settings. For example, these techniques mayapply to over-the-air television broadcasts, cable televisiontransmissions, satellite television transmissions, Internet videotransmissions, encoded digital video that is encoded onto a storagemedium, or other scenarios. Accordingly, communication channel 16 maycomprise any combination of wireless or wired media suitable fortransmission of encoded video data.

In the example of FIG. 1, source device 12 includes a video source 18,video encoder 20, a modulator/demodulator (modem) 22 and a transmitter24. Destination device 14 includes a receiver 26, a modem 28, a videodecoder 30, and a display device 32. In accordance with this disclosure,video encoder 20 of source device 12 may be configured to apply thetechniques for geometric motion partitioning. In other examples, asource device and a destination device may include other components orarrangements. For example, source device 12 may receive video data froman external video source 18, such as an external camera. Likewise,destination device 14 may interface with an external display device,rather than including an integrated display device.

The illustrated system 10 of FIG. 1 is merely one example. Techniquesfor geometric motion partitioning may be performed by any digital videoencoding and/or decoding device. Although generally the techniques ofthis disclosure are performed by a video encoding device, the techniquesmay also be performed by a video encoder/decoder, typically referred toas a “CODEC.” Moreover, certain aspects of the techniques of thisdisclosure may also be performed by a video preprocessor. Source device12 and destination device 14 are merely examples of such coding devicesin which source device 12 generates coded video data for transmission todestination device 14. In some examples, devices 12, 14 may operate in asubstantially symmetrical manner such that each of devices 12, 14include video encoding and decoding components. Hence, system 10 maysupport one-way or two-way video transmission between video devices 12,14, e.g., for video streaming, video playback, video broadcasting, orvideo telephony.

Video source 18 of source device 12 may include a video capture device,such as a video camera, a video archive containing previously capturedvideo, and/or a video feed from a video content provider. As a furtheralternative, video source 18 may generate computer graphics-based dataas the source video, or a combination of live video, archived video, andcomputer-generated video. In some cases, if video source 18 is a videocamera, source device 12 and destination device 14 may form so-calledcamera phones or video phones. As mentioned above, however, thetechniques described in this disclosure may be applicable to videocoding in general, and may be applied to wireless and/or wiredapplications. In each case, the captured, pre-captured, orcomputer-generated video may be encoded by video encoder 20. The encodedvideo information may then be modulated by modem 22 according to acommunication standard, and transmitted to destination device 14 viatransmitter 24. Modem 22 may include various mixers, filters, amplifiersor other components designed for signal modulation. Transmitter 24 mayinclude circuits designed for transmitting data, including amplifiers,filters, and one or more antennas.

Receiver 26 of destination device 14 receives information over channel16, and modem 28 demodulates the information. Again, the video encodingprocess may implement one or more of the techniques described herein togeometric motion partitioning. The information communicated over channel16 may include syntax information defined by video encoder 20, which isalso used by video decoder 30, that includes syntax elements thatdescribe characteristics and/or processing of macroblocks and othercoded units, e.g., groups of pictures (GOPs). Display device 32 displaysthe decoded video data to a user, and may comprise any of a variety ofdisplay devices such as a cathode ray tube (CRT), a liquid crystaldisplay (LCD), a plasma display, an organic light emitting diode (OLED)display, or another type of display device.

In the example of FIG. 1, communication channel 16 may comprise anywireless or wired communication medium, such as a radio frequency (RF)spectrum or one or more physical transmission lines, or any combinationof wireless and wired media. Communication channel 16 may form part of apacket-based network, such as a local area network, a wide-area network,or a global network such as the Internet. Communication channel 16generally represents any suitable communication medium, or collection ofdifferent communication media, for transmitting video data from sourcedevice 12 to destination device 14, including any suitable combinationof wired or wireless media. Communication channel 16 may includerouters, switches, base stations, or any other equipment that may beuseful to facilitate communication from source device 12 to destinationdevice 14.

Video encoder 20 and video decoder 30 may operate according to a videocompression standard, such as the ITU-T H.264 standard, alternativelyreferred to as MPEG-4, Part 10, Advanced Video Coding (AVC). Thetechniques of this disclosure, however, are not limited to anyparticular coding standard. Other examples include MPEG-2 and ITU-TH.263. Although not shown in FIG. 1, in some aspects, video encoder 20and video decoder 30 may each be integrated with an audio encoder anddecoder, and may include appropriate MUX-DEMUX units, or other hardwareand software, to handle encoding of both audio and video in a commondata stream or separate data streams. If applicable, MUX-DEMUX units mayconform to the ITU H.223 multiplexer protocol, or other protocols suchas the user datagram protocol (UDP).

The ITU-T H.264/MPEG-4 (AVC) standard was formulated by the ITU-T VideoCoding Experts Group (VCEG) together with the ISO/IEC Moving PictureExperts Group (MPEG) as the product of a collective partnership known asthe Joint Video Team (JVT). In some aspects, the techniques described inthis disclosure may be applied to devices that generally conform to theH.264 standard. The H.264 standard is described in ITU-T RecommendationH.264, Advanced Video Coding for generic audiovisual services, by theITU-T Study Group, and dated March, 2005, which may be referred toherein as the H.264 standard or H.264 specification, or the H.264/AVCstandard or specification. The Joint Video Team (JVT) continues to workon extensions to H.264/MPEG-4 AVC.

Video encoder 20 and video decoder 30 each may be implemented as any ofa variety of suitable encoder circuitry, such as one or moremicroprocessors, digital signal processors (DSPs), application specificintegrated circuits (ASICs), field programmable gate arrays (FPGAs),discrete logic, software, hardware, firmware or any combinationsthereof. Each of video encoder 20 and video decoder 30 may be includedin one or more encoders or decoders, either of which may be integratedas part of a combined encoder/decoder (CODEC) in a respective camera,computer, mobile device, subscriber device, broadcast device, set-topbox, server, or the like.

A video sequence typically includes a series of video frames, alsoreferred to as video pictures. A group of pictures (GOP) generallycomprises a series of one or more video frames. A GOP may include syntaxdata in a header of the GOP, a header of one or more frames of the GOP,or elsewhere, that describes a number of frames included in the GOP.Each frame may include frame syntax data that describes an encoding modefor the respective frame. Video encoder 20 typically operates on videoblocks within individual video frames in order to encode the video data.A video block may correspond to a macroblock, a partition of amacroblock, or a block larger than a macroblock. The video blocks mayhave fixed or varying sizes, and may differ in size according to aspecified coding standard. Each video frame may include one or moreslices. Each slice may include a plurality of macroblocks, which may bearranged into partitions, also referred to as sub-blocks.

As an example, the ITU-T H.264 standard supports intra prediction invarious block sizes, such as 16 by 16, 8 by 8, or 4 by 4 for lumacomponents, and 8×8 for chroma components, as well as inter predictionin various block sizes, such as 16×16, 16×8, 8×16, 8×8, 8×4, 4×8 and 4×4for luma components and corresponding scaled sizes for chromacomponents. In this disclosure, “N×N” and “N by N” may be usedinterchangeably to refer to the pixel dimensions of the block in termsof vertical and horizontal dimensions, e.g., 16×16 pixels or 16 by 16pixels. In general, a 16×16 block will have 16 pixels in a verticaldirection (y=16) and 16 pixels in a horizontal direction (x=16).Likewise, an N×N block generally has N pixels in a vertical directionand N pixels in a horizontal direction, where N represents a nonnegativeinteger value. The pixels in a block may be arranged in rows andcolumns. Moreover, blocks need not necessarily have the same number ofpixels in the horizontal direction as in the vertical direction. Forexample, blocks may comprise N×M pixels, where M is not necessarilyequal to N.

Block sizes that are less than 16 by 16 may be referred to as partitionsof a 16 by 16 macroblock. Video blocks may comprise blocks of pixel datain the pixel domain, or blocks of transform coefficients in thetransform domain, e.g., following application of a transform such as adiscrete cosine transform (DCT), an integer transform, a wavelettransform, or a conceptually similar transform to the residual videoblock data representing pixel differences between coded video blocks andpredictive video blocks. In some cases, a video block may compriseblocks of quantized transform coefficients in the transform domain.

Smaller video blocks can provide better resolution, and may be used forlocations of a video frame that include high levels of detail. Ingeneral, macroblocks and the various partitions, sometimes referred toas sub-blocks, may be considered video blocks. In addition, a slice maybe considered to be a plurality of video blocks, such as macroblocksand/or sub-blocks. Each slice may be an independently decodable unit ofa video frame. Alternatively, frames themselves may be decodable units,or other portions of a frame may be defined as decodable units. The term“coded unit” or “coding unit” may refer to any independently decodableunit of a video frame such as an entire frame, a slice of a frame, agroup of pictures (GOP) also referred to as a sequence, or anotherindependently decodable unit defined according to applicable codingtechniques.

In accordance with the techniques of this disclosure, video encoder 20may be configured to use geometric motion partitioning during inter-modeencoding of a block, e.g., a macroblock. That is, video encoder 20 maydetermine that the block can be best encoded using a geometric motionpartition line, also referred to as a geometry partition. The origin isassumed to be at the center of the block. Then, each geometric motionpartition line is defined by a line passing through the origin that isperpendicular to the line defining the partition boundary. That is,video encoder 20 may define the geometric motion partition line usingtwo parameters: the length ρ (rho) of the line segment perpendicular tothe partition line and originating at the center point of thepartitioned block, and the angle θ (theta) of the perpendicular linerelative to a horizontal line passing through the center point of thepartitioned block. In other words, the geometric motion partition lineis defined by the angle subtended by the perpendicular line with theX-axis and the distance of the partition line from the origin. Videoencoder 20 may be configured to determine that a block should bepartitioned into two partitions, and to calculate a partition linedefined according to (ρ, θ) that best fits the division between the twopartitions. Equation (1) below defines a geometric motion partitionline:

$\begin{matrix}{y = {{{\frac{- 1}{\tan (\theta)}x} + \frac{\rho}{\sin (\theta)}} = {{mx} + {c.}}}} & (1)\end{matrix}$

In various examples, video encoder 20 may be configured to use blocks ofa fixed or variable size, such as, for example, 16×16, 32×32, and/or64×64 blocks. In general, for an N×N block, video encoder 20 may selecta value for ρ in the range of [0, (N/2)−1], inclusive. Thus, for a 16×16block, video encoder 20 may be configured to select a value for ρ in therange of [0, 7], inclusive. As another example, for a 32×32 block, videoencoder 20 may be configured to select a value for ρ in the range of [0,15], inclusive. As yet another example, for a 64×64 block, video encoder20 may be configured to select a value for ρ in the range of [0, 31],inclusive. In some examples, video encoder 20 may be configured toselect a value for θ in the range of [0, 31], inclusive. Thus, the rangeof values for θ may have a step size of 11.25 degrees. In theseexamples, there may be 256 possible geometry partitions for block sizesof 16×16, 512 possible geometry partitions for block sizes of 32×32, and1024 possible geometry partitions for block sizes of 64×64. However, theblock size and selection of step size of ρ and θ are not necessarilylimited to the values mentioned above.

Video encoder 20 and video decoder 30 may be configured to determine towhich geometric motion partition a particular pixel corresponds, andshould be configured such that both the encoder and decoder select thesame partition for a given pixel. In some examples, video encoder 20 andvideo decoder 30 may use fixed point calculations when partitioning ablock using a geometric motion partition. Indications of whether pixelscorrespond to region zero or region one can be efficiently stored as abinary mask with zero indicating that a pixel belongs to region zero andone indicating that the pixel belongs to region one. Due to the numberof possible geometry partitions and block sizes, it may be prohibitiveto store all the masks at video encoder 20 and video decoder 30. Thus,this disclosure includes techniques for calculating the masks on thefly, and in some examples, using fixed point arithmetic.

Slope m and y-intercept c in formula (1) contain trigonometricfunctions, and thus calculation of the masks on the fly based strictlyon this formula would require a floating point implementation. In somecases, it is difficult or even impossible for two devices to havematching floating point implementations. Accordingly, the masks may becalculated using fixed point arithmetic. Thus, calculating a predictionvalue for a pixel in the transition region may include calculating amask indicative of pixels of the block in the first partition and pixelsof the block in the second partition, and locating at least oneneighboring pixel to the pixel in the transition region in the firstpartition and at least one neighboring pixel in the second partitionbased on the mask, using fixed point arithmetic.

In examples using fixed point arithmetic, cases where θ=0 and θ=π may beexcluded, as the geometric motion partition would be a vertical linewith infinite slope and infinite y-intercept. For remaining cases, 1/tanθ and 1/sin θ may be represented using fixed point values. The otherparameter, ρ, may already be expressed as an integer. For 1/tan θ, themaximum absolute value for the remaining values of θ is 5.0273 and themaximum absolute difference between two consecutive values of 1/tan θmay be 0.1989. Similarly, for 1/sin θ, the maximum absolute value may be5.1258, and the maximum absolute difference between two consecutivevalues of 1/sin θ may be 0.0196. To convert the mask calculation into afixed point operation, video encoder 20 may multiply 1/tan θ and 1/sin θby a suitable power of 2 and round the results to the nearest integer.

In one example, for fixed point implementation, a video encoder 20 maymultiply the 1/tan θ and 1/sin θ by 2²⁰, or 1048576, and round them tothe nearest integers. Since the maximum value of ρ is 32 in the exampleof a block size up to 64×64 with a step size of 1, a 25-bit signedimplementation is adequate for representing the y-intercept value.Because x, in the expression “mx,” can take values from −32 to 31, mxcan also be represented as a 25-bit signed integer. In some examples,video encoder 20 and video decoder 30 may use 32-bit, signed integers tostore values of 1/tan θ and 1/sin θ, for each of 32 values of θ. Due tothe symmetric properties of the sin and tan functions, video encoder 20and video decoder 30 may be configured to store only 8 values of slopesand intercepts as 32-bit signed integers. As indicated earlier, thesestored values do not need to be used when θ=0 and θ=π.

Video encoder 20 and video decoder 30 may be configured to deriveidentical masks using fixed point operations. This may avoid causingdrift error between video encoder 20 and video decoder 30, which mayotherwise be caused by geometric motion partitioning. Let region zero bedefined such that for any point (x₀, y₀) in region 0, y₀−m*x₀>=c.Similarly, let region one be defined such that for any point (x₁, y₁) inregion 1, y₁−m*x₁<c. For any geometric motion partition, and any point(x, y), video encoder 20 may calculate y−m*x in fixed point and comparethe result with the y-intercept to determine whether the point belongsto region zero or region one. When θ=0 or θ=π, the geometric motionpartition is a vertical line defined by x=ρ. In that case all pointsfrom the block with x<p may be defined to belong to partition 0 and theremaining points (x>=ρ) may be defined to belong to partition 1. Videoencoder 20 and video decoder 30 may be configured to iterate througheach point in a block to calculate a mask for the block indicating whichpoints correspond to region zero and which points correspond to regionone. After calculating the mask for a block using fixed pointoperations, remaining computations for geometry based motion partitionmay be based on the mask.

In this manner, video encoder 20 may correspond to an example of a videoencoder configured to partition a block of video data into a firstpartition and a second partition using a geometric motion partitionline, calculate a slope value and a y-intercept value of the geometricmotion partition line, wherein the slope value and the y-intercept valuecomprise integer values, calculate a mask indicative of pixels of theblock in the first partition and pixels of the block in the secondpartition, encode the first partition and the second partition based onthe mask, and output the encoded first partition, the encoded secondpartition, the slope value, and the y-intercept value.

Partitioning of the block using a geometric motion partition may producetwo nonrectangular partitions of the block, each having a respectivemotion vector. The partitions may correspond to prediction values forthe block being encoded. Video encoder 20 may also encode the motionvectors for the geometric motion partitions. Video encoder 20 may encodemotion vectors relative to a motion predictor. Video encoder 20 mayselect the motion predictor as the median of the motion vectors ofneighboring blocks that have already been encoded, e.g., blocks above,to the left of, and above-right of the current block, assuming a rasterscan ordering when encoding the blocks. The techniques of thisdisclosure include selecting the median from a broader set of candidatemotion vectors than are used in conventional coding standards, and usingpotentially different candidate motion vectors for each motion vector ofthe block. That is, video encoder 20 may determine to use differentmotion predictors for the motion vectors of the geometric motionpartitions of a single block.

In addition, video encoder 20 calculates residual values for the block.In general, a residual value for a pixel of the block corresponds to thedifference between the actual value for the pixel of the block and theprediction value for the collocated pixel of the block. In one example,the techniques of this disclosure include smoothing the transitionacross the geometric motion partition line. To do so, video encoder 20may be configured with a particular transition region around thepartition line. As an example, video encoder 20 may be configured to usea 3×3 pixel window centered on a current pixel. As an example, videoencoder 20 may be configured to determine that the current pixel is inthe transition region if at least two of the immediate upper, lower,left, and right pixels belong to different partitions. As anotherexample, video encoder 20 may be configured to determine that thecurrent pixel is in the transition region if at least two of theimmediate eight neighboring pixels belong to different partitions. Inother examples, these schemes can be extended to different sizes ofwindows centered around a current pixel in which pixels are consideredin determining whether the current pixel belongs in the transitionregion.

To smooth the transition, video encoder 20 may be configured to apply alow pass filter across the partition line. The filter may correspond toa matrix, e.g., a 3×3 matrix, of coefficients centered on a pixel to befiltered. Thus, the filter may be centered on the pixel in thetransition region. The low pass filter may have various coefficients.One example of a low pass filter may be:

$\begin{matrix}1 & 2 & 1 \\2 & 3 & 2 \\1 & 2 & {1,}\end{matrix}\quad$

where the ‘3’ coefficient corresponds to the current pixel, and theother coefficients correspond to the other immediate neighboring pixelsto the current pixel. Another example of a low pass filter may be:

$\begin{matrix}0 & 1 & 0 \\1 & 4 & 1 \\0 & 1 & {0,}\end{matrix}\quad$

where the ‘4’ coefficient corresponds to the current pixel, and theother coefficients correspond to the other immediate neighboring pixelsto the current pixel. To calculate a prediction value for the pixel inthe transition region, video encoder 20 may calculate products of thecoefficients of the filter and values of pixels collocated with thecoefficients (when the filter is centered on the pixel in the transitionregion), calculate the sum of the products, and divide the sum of theproducts by the sum of the coefficients.

In this manner, video encoder 20 corresponds to an example of a videoencoder configured to partition a block of video data into a firstpartition and a second partition using a geometric motion partitionline, calculate a prediction value of a pixel in a transition region ofthe block using a filter that applies a value for at least oneneighboring pixel from the first partition and a value for at least oneneighboring pixel from the second partition, calculate a residual valueof the pixel in the transition region of the block based on theprediction value of the pixel in the transition region, and output theresidual value of the pixel.

In some examples, for smoothing in the transition region, video encoder20 selectively performs filtering based on various conditions centeredon a current pixel. The conditions may include difference of pixelvalues (or a certain form of gradient) along a direction perpendicularto the partition line, motion vector difference between the twopartitions of the block, partition line direction, reference frameindexes, quantization parameters, and number of pixels of the twopartitions. Other conditions may also be analyzed to determine whetherand how to filter the pixels in the transition region.

Another method for improving visual quality includes overlapping twopredictions for pixels inside the transition region. Video encoder 20may generate two predictions for pixels belonging to the transitionregion, using each motion vector for the partitions of the block. Videoencoder 20 may then combine the two predictions using a weighted sum.For example, if a pixel belongs to partition one and is also in thetransition region, video encoder 20 may weight the prediction value fromthe first partition value using a weight of ⅔, and a weight of ⅓ for theprediction value from the other partition. Other weight values such as(¾, ¼) or (½, ½) may be applied in other examples. In some examples, theweight values may be determined adaptively.

In some examples, the weighting coefficients for the weighted sumoperation are determined based on various conditions centered on acurrent pixel. The conditions may include difference of pixel values (ora certain form of gradient) along a direction perpendicular to thepartition line, motion vector difference between the two partitions ofthe block, partition line direction, reference frame indexes,quantization parameters, and number of pixels of the two partitions.Other conditions may also be analyzed to determine whether and how tofilter the pixels in the transition region.

Video encoder 20 may apply a transform to the residual value, such as adiscrete cosine transform, 4×4 integer transform, 8×8 transform, 16×16transform, or other transform. In one example, video encoder 20 mayadaptively select a transform size for the residual of a partition ofthe block, based on whether the geometric motion partition line passesthrough the partition. In this instance, the term partition refers to an(N/2)×(N/2) or smaller partition of an N×N block, as opposed to ageometric motion partition.

As an example, suppose an N×N block is partitioned using a geometricmotion partition line. Video encoder 20 may divide the N×N block intofour non-overlapping (N/2)×(N/2) blocks. Then for each (N/2)×(N/2)block, video encoder 20 may determine whether the geometric motionpartition passes through the (N/2)×(N/2). If the geometric motionpartition line does not pass through the (N/2)×(N/2) block, videoencoder 20 may use a transform size of (N/2)×(N/2) for the block. On theother hand, if the geometric motion partition line passes through the(N/2)×(N/2), video encoder 20 may perform the method recursively:dividing the (N/2)×(N/2) into four non-overlapping (N/4)×(N/4) blocksand determining whether the geometric motion partition line passesthrough any of the (N/4)×(N/4) blocks. Video encoder 20 may beconfigured with a minimum transform size, e.g., 4×4, at which pointvideo encoder 20 may select the minimum transform size for a sub-blockregardless of whether the geometric motion partition line passes throughthe sub-block.

In this manner, video encoder 20 may correspond to an example of a videoencoder configured to partition a block of video data into a firstgeometric partition and a second geometric partition using a geometricmotion partition line, wherein the block comprises N×N pixels, dividethe block of video data into four equally-sized, non-overlapping(N/2)×(N/2) sub-blocks, and encode at least one of the sub-blocksthrough which the geometric motion partition line passes using atransform size smaller than (N/2)×(N/2).

Following intra-predictive or inter-predictive coding to producepredictive data and residual data, and following any transforms (such asthe 4×4 or 8×8 integer transform used in H.264/AVC or a discrete cosinetransform DCT) to produce transform coefficients, quantization oftransform coefficients may be performed. Quantization generally refersto a process in which transform coefficients are quantized to possiblyreduce the amount of data used to represent the coefficients. Thequantization process may reduce the bit depth associated with some orall of the coefficients. For example, an n-bit value may be rounded downto an m-bit value during quantization, where n is greater than m.

Following quantization, entropy coding of the quantized data may beperformed, e.g., according to content adaptive variable length coding(CAVLC), context adaptive binary arithmetic coding (CABAC), or anotherentropy coding methodology. A processing unit configured for entropycoding, or another processing unit, may perform other processingfunctions, such as zero run length coding of quantized coefficientsand/or generation of syntax information such as coded block pattern(CBP) values, macroblock type, coding mode, maximum macroblock size fora coded unit (such as a frame, slice, macroblock, or sequence), or thelike.

Video encoder 20 may further send syntax data, such as block-basedsyntax data, frame-based syntax data, and GOP-based syntax data, tovideo decoder 30, e.g., in a frame header, a block header, a sliceheader, or a GOP header. For example, where video encoder 20 providesintegers for angle and length values that define a geometric motionpartition, to allow for fixed point arithmetic, video encoder 20 maysignal the use of integers. Video encoder 20 may signal this in asequence parameter set or a picture parameter set. Alternatively, videoencoder 20 may use a redefined set of profiles and/or levels, and thusmay select a profile indicator (profile_idc) or level indicator(level_idc) value indicative of the use of integer values to allow forfixed point arithmetic with respect to the geometric motion partition.Video encoder 20 may also signal whether geometric motion partitions areenabled for a sequence of pictures and/or individual pictures.

Moreover, video encoder 20 may signal whether smoothing has been enabledfor a block, and if so, how the smoothing is accomplished, e.g., anindication of a smoothing filter. For example, video encoder 20 maysignal the coefficients of the smoothing filter. Video encoder 20 mayalso signal whether adaptive transform size selection is enabled. Videoencoder 20 may also signal whether the extended set of candidate motionvectors is permitted for a picture, to encode a motion vector relativeto a motion predictor.

Video decoder 30 may be configured to use the techniques of thisdisclosure when decoding received video data. The techniques applied byvideo decoder 30 may essentially be symmetrical to those applied byvideo encoder 20. For example, video decoder 30 may receive fixed pointvalues for a slope and intercept defining a geometric motion partitionfor an encoded block, in order to achieve a fixed point implementationof these techniques. Thus, video decoder 30 may calculate a mask for theblock on the fly, based on the slope and intercept of the geometricmotion partition, iterating through each pixel location for the block todetermine whether the pixel falls into region zero or region one.

In this manner, video decoder 30 may correspond to an example of a videodecoder configured to receive an encoded block of video data that hasbeen partitioned into a first partition and a second partition by ageometric motion partition line, receive a slope value and a y-interceptvalue defining the geometric motion partition line, wherein the slopevalue and the y-intercept value comprise integer values, calculate amask indicative of pixels of the block in the first partition and pixelsof the block in the second partition, decode the first partition and thesecond partition of the block based on the mask, and output the decodedblock.

As another example, video decoder 30 may implement smoothing techniquesto smooth the transition region of a block at a geometric motionpartition line for the block. Video decoder 30 may receive motionvectors for each geometric motion partition of the block to determineprediction values for pixels of the block. Video decoder 30 may apply asmoothing filter to pixels in the geometric motion partition transitionregion, as described above. Thus, video decoder 30 may correspond to anexample of a video decoder configured to receive an encoded block ofvideo data, a definition of a geometric motion partition line thatpartitions the encoded block into a first partition and a secondpartition, and a residual value for a pixel in a transition region ofthe block, calculate a prediction value of the pixel in the transitionregion of the block using a filter that applies a value for at least oneneighboring pixel from the first partition and a value for at least oneneighboring pixel from the second partition, calculate a reconstructedvalue for the pixel in the transition region of the block based on theprediction value and the residual value, and output the reconstructedvalue of the pixel.

As yet another example, video decoder 30 may receive keywords forresidual values of various sizes, based on adaptive transform sizeselection. These keywords, which may correspond to variable lengthcodes, may correspond to different dictionaries, based on the transformsize for the blocks. Thus, video decoder 30 may determine a transformsize for a particular block based on whether the geometric motionpartition line passes through the block. In this manner, video decoder30 may correspond to an example of a video decoder configured to receivean encoded block of video data partitioned into a first geometricpartition and a second geometric partition by a geometric motionpartition line, wherein the block comprises N×N pixels, divide the blockof video data into four equally-sized, non-overlapping (N/2)×(N/2)sub-blocks, and inverse transform at least one of the sub-blocks throughwhich the geometric motion partition line passes using a transform sizesmaller than (N/2)×(N/2).

As still another example, video decoder 30 may decode motion vectors forthe geometric motion partitions relative to motion predictors. Inaccordance with the techniques of this disclosure, video decoder 30 maydetermine the motion predictors from a larger set of candidate motionvectors, and may determine the motion predictors for each geometrypartition individually. In this manner, video decoder 30 may correspondto an example of a video decoder configured to receive a block of videodata partitioned by a geometric motion partition line into a firstpartition and a second partition, a first encoded motion vector for thefirst partition, and a second encoded motion vector for the secondpartition, decode the first encoded motion vector based on a firstmotion predictor selected from motion vectors for blocks neighboring thefirst partition, decode the second encoded motion vector based on asecond motion predictor selected from motion vectors for blocksneighboring the second partition, wherein the blocks neighboring thesecond partition are determined independently of the blocks neighboringthe first partition, and decode the block using the decoded first andsecond motion vectors.

Video encoder 20 and video decoder 30 each may be implemented as any ofa variety of suitable encoder or decoder circuitry, as applicable, suchas one or more microprocessors, digital signal processors (DSPs),application specific integrated circuits (ASICs), field programmablegate arrays (FPGAs), discrete logic circuitry, software, hardware,firmware or any combinations thereof. Each of video encoder 20 and videodecoder 30 may be included in one or more encoders or decoders, eitherof which may be integrated as part of a combined video encoder/decoder(CODEC). An apparatus including video encoder 20 and/or video decoder 30may comprise an integrated circuit, a microprocessor, and/or a wirelesscommunication device, such as a cellular telephone.

Video encoder 20 and video decoder 30 may be configured to perform anycombination of the techniques of this disclosure. That is, video encoder20 and video decoder 30 may be configured to perform any one or more ofa fixed point implementation for geometric motion partitioning,smoothing of a transition region defined by a geometric motion partitionboundary, encoding motion vectors for each geometric motion partition,and/or adaptive transform size selection for sub-blocks based on whetherthe geometric motion partition line passes through the sub-blocks, inany combination.

In some examples, although video encoder 20 and video decoder 30 mayimplement certain techniques described in this disclosure, thetechniques may be disabled, or one of video encoder 20 and video decoder30 may not support the same set of techniques. Accordingly, videoencoder 20 may signal which techniques are used for a particular videostream, and video decoder 30 may select whether or not to retrieve oruse the video stream, based on whether video decoder 30 supports thetechniques used to encode the video stream. For example, video encoder20 may signal which techniques are used in a sequence parameter set, apicture parameter set, using a profile indicator (profile_idc value), alevel indicator (level_idc value), header data, or other descriptivedata.

FIG. 2 is a block diagram illustrating an example of video encoder 20that may implement techniques for geometric motion partitioning. Videoencoder 20 may perform intra- and inter-coding of blocks within videoframes, including macroblocks, or partitions or sub-partitions ofmacroblocks. Intra-coding relies on spatial prediction to reduce orremove spatial redundancy in video within a given video frame.Inter-coding relies on temporal prediction to reduce or remove temporalredundancy in video within adjacent frames of a video sequence.Intra-mode (I-mode) may refer to any of several spatial basedcompression modes and inter-modes such as uni-directional prediction(P-mode) or bi-directional prediction (B-mode) may refer to any ofseveral temporal-based compression modes. Although components forinter-mode encoding are depicted in FIG. 2, it should be understood thatvideo encoder 20 may further include components for intra-mode encoding.However, such components are not illustrated for the sake of brevity andclarity.

As shown in FIG. 2, video encoder 20 receives a current video blockwithin a video frame to be encoded. In the example of FIG. 2, videoencoder 20 includes mode select unit 40, motion estimation unit 42,motion compensation unit 44, intra prediction unit 46, reference framestore 64, summer 50, transform unit 52, quantization unit 54, andentropy coding unit 56. For video block reconstruction, video encoder 20also includes inverse quantization unit 58, inverse transform unit 60,and summer 62. A deblocking filter (not shown in FIG. 2) may also beincluded to filter block boundaries to remove blockiness artifacts fromreconstructed video. If desired, the deblocking filter would typicallyfilter the output of summer 62.

During the encoding process, video encoder 20 receives a video frame orslice to be coded. The frame or slice may be divided into multiple videoblocks. Motion estimation unit 42 and motion compensation unit 44perform inter-predictive coding of the received video block relative toone or more blocks in one or more reference frames to provide temporalcompression. An intra prediction unit may also perform intra-predictivecoding of the received video block relative to one or more neighboringblocks in the same frame or slice as the block to be coded to providespatial compression.

Mode select unit 40 may select one of the coding modes, intra or inter,e.g., based on error results, and provides the resulting intra- orinter-coded block to summer 50 to generate residual block data and tosummer 62 to reconstruct the encoded block for use as a reference frame.

Motion estimation unit 42 and motion compensation unit 44 may be highlyintegrated, but are illustrated separately for conceptual purposes.Motion estimation is the process of generating motion vectors, whichestimate motion for video blocks. A motion vector, for example, mayindicate the displacement of a predictive block within a predictivereference frame (or other coded unit) relative to the current blockbeing coded within the current frame (or other coded unit). A predictiveblock is a block that is found to closely match the block to be coded,in terms of pixel difference, which may be determined by sum of absolutedifference (SAD), sum of square difference (SSD), or other differencemetrics. A motion vector may also indicate displacement of a partitionof a macroblock. Motion compensation may involve fetching or generatingthe predictive block based on the motion vector determined by motionestimation. Again, motion estimation unit 42 and motion compensationunit 44 may be functionally integrated, in some examples.

In some examples, motion estimation unit 42 may determine that a blockshould be partitioned using a geometric motion partition line. Motionestimation unit 42 may calculate the parameters for the geometric motionpartition line, e.g., angle θ and distance ρ of a line from the originof the partitioned block to the midpoint of the geometric motionpartition line. In some examples, motion estimation unit 42 maydetermine the parameters as the slope m and y-intercept c of thegeometric motion partition line, in order to allow for a fixed pointimplementation of these techniques. In addition, video encoder 20 andvideo decoder 30 (FIGS. 1 and 3) may store identical copies of look-uptables for 1/tan(θ) and 1/sin(θ) for different values of θ. For ageometry mode, video encoder 20 may signal values for θ and ρ in theoutput bitstream. Video decoder 30 may be configured to use the signaledvalues to perform fixed point calculations to calculate a mask that isthe same as the mask calculated by video encoder 20.

Motion estimation unit 42 calculates a motion vector for the videoblock, or a geometric motion partition thereof, of an inter-coded frameby comparing the video block to video blocks (or partitions) of areference frame in reference frame store 64. Motion compensation unit 44may also interpolate sub-integer pixels of the reference frame, e.g., anI-frame or a P-frame. The ITU H.264 standard refers to reference framesas “lists.” Therefore, data stored in reference frame store 64 may bestored in the lists. Motion estimation unit 42 compares blocks of one ormore reference frames from reference frame store 64 to a block to beencoded of a current frame, e.g., a P-frame or a B-frame. When thereference frames in reference frame store 64 include values forsub-integer pixels, a motion vector calculated by motion estimation unit42 may refer to a sub-integer pixel location of a reference frame.

In some examples, motion estimation unit 42 may calculate a differencebetween a motion vector and a motion predictor, in order to encode themotion vector. Motion estimation unit 42 may select the motion predictoras the median of the motion vectors of blocks above, to the left of,above and to the left of, and above and to the right of the currentblock being encoded. Motion estimation unit 42 may also determinewhether the blocks above and to the left of the current block have beenpartitioned, and if so, whether these partitions have distinct motionvectors. If so, motion estimation unit 42 may select the motionpredictor from the median of all of these candidate motion vectors.After determining the motion predictor, motion estimation unit 42 maycalculate the difference between the motion vector and the motionpredictor. Motion estimation unit 42 sends the calculated difference toentropy coding unit 56 and the calculated motion vector to motioncompensation unit 44.

Motion compensation unit 44 may calculate prediction data based on thepredictive block. Video encoder 20 forms a residual video block bysubtracting the prediction data from motion compensation unit 44 fromthe original video block being coded. Summer 50 represents the componentor components that perform this subtraction operation.

In some examples, motion compensation unit 44 may filter of pixels in ablock at a transition region defined by a geometric motion partitionline for the block, in accordance with the techniques of thisdisclosure. For example, motion compensation unit 44 may calculateprediction values for pixels in the transition region using a 3×3 pixelfilter that takes account of values from both region zero and regionone, where region zero and region one correspond to geometric motionpartitions. As another example, motion compensation unit 44 maycalculate prediction values for pixels in the transition region bycalculating a weighted sum of the value for the pixel in region zero andthe value for the pixel in region one. After calculating a predictionvalue for a pixel in the transition region, summer 50 may calculate aresidual value for the pixel as the difference between the predictionvalue and the actual value of the pixel. In this manner, the residualvalue calculated by summer 50 may be based on the smoothed predictionvalues calculated by motion compensation unit 44.

Transform unit 52 applies a transform, such as a discrete cosinetransform (DCT) or a conceptually similar transform, to the residualblock, producing a video block comprising residual transform coefficientvalues. Transform unit 52 may perform other transforms, such as thosedefined by the H.264 standard, which are conceptually similar to DCT.Wavelet transforms, integer transforms, sub-band transforms or othertypes of transforms could also be used. In any case, transform unit 52applies the transform to the residual block, producing a block ofresidual transform coefficients. The transform may convert the residualinformation from a pixel value domain to a transform domain, such as afrequency domain.

In some examples, transform unit 52 may receive blocks of various sizesfrom motion compensation unit 44. Motion compensation unit 44 may beconfigured to select a block size based on whether the block touches thegeometric motion partition line. For example, suppose the original blockis a 16×16 block. Motion compensation unit 44 may divide the originalblock into four 8×8 blocks. Then, motion compensation unit 44 may divideany of the four 8×8 blocks that touch the geometric motion partitionline into 4×4 blocks. Transform unit 52 may be configured withtransforms for each potential block size. In this manner, video encoder20 may perform an adaptive transform size selection for geometric motionpartitioned blocks when calculating residual values for the blocks.Although the example of a 16×16 block is described, similar techniquesmay be applied to other size blocks, e.g., 32×32, 64×64, etc. Moreover,motion compensation unit 44 may be configured with a minimum block size,e.g., 4×4.

Quantization unit 54 quantizes the residual transform coefficients tofurther reduce bit rate. The quantization process may reduce the bitdepth associated with some or all of the coefficients. The degree ofquantization may be modified by adjusting a quantization parameter.

Following quantization, entropy coding unit 56 entropy codes thequantized transform coefficients. For example, entropy coding unit 56may perform content adaptive variable length coding (CAVLC), contextadaptive binary arithmetic coding (CABAC), or another entropy codingtechnique. Following the entropy coding by entropy coding unit 56, theencoded video may be transmitted to another device or archived for latertransmission or retrieval. In the case of context adaptive binaryarithmetic coding, context may be based on neighboring macroblocks.

In some cases, entropy coding unit 56 or another unit of video encoder20 may be configured to perform other coding functions, in addition toentropy coding. For example, entropy coding unit 56 may be configured todetermine the CBP values for the macroblocks and partitions. Also, insome cases, entropy coding unit 56 may perform run length coding of thecoefficients in a macroblock or partition thereof. In particular,entropy coding unit 56 may apply a zig-zag scan or other scan pattern toscan the transform coefficients in a macroblock or partition and encoderuns of zeros for further compression. Entropy coding unit 56 also mayconstruct header information with appropriate syntax elements fortransmission in the encoded video bitstream.

Inverse quantization unit 58 and inverse transform unit 60 apply inversequantization and inverse transformation, respectively, to reconstructthe residual block in the pixel domain, e.g., for later use as areference block. Motion compensation unit 44 may calculate a referenceblock by adding the residual block to a predictive block of one of theframes of reference frame store 64. Motion compensation unit 44 may alsoapply one or more interpolation filters to the reconstructed residualblock to calculate sub-integer pixel values for use in motionestimation. Summer 62 adds the reconstructed residual block to themotion compensated prediction block produced by motion compensation unit44 to produce a reconstructed video block for storage in reference framestore 64. The reconstructed video block may be used by motion estimationunit 42 and motion compensation unit 44 as a reference block tointer-code a block in a subsequent video frame.

FIG. 3 is a block diagram illustrating an example of video decoder 30,which decodes an encoded video sequence. In the example of FIG. 3, videodecoder 30 includes an entropy decoding unit 70, motion compensationunit 72, intra prediction unit 74, inverse quantization unit 76, inversetransformation unit 78, reference frame store 82 and summer 80. Videodecoder 30 may, in some examples, perform a decoding pass generallyreciprocal to the encoding pass described with respect to video encoder20 (FIG. 2). Intra prediction unit 74 may use intra prediction modesreceived in the bitstream to form a prediction block from spatiallyadjacent blocks.

Motion compensation unit 72 may generate prediction data based on motionvectors received from entropy decoding unit 70. When an encoded block ispartitioned using a geometric motion partition line, motion compensationunit 72 may receive a definition of the geometric motion partition linefor the block in order to determine which pixels of the block correspondto which partition. In some examples, the definition of the line may beaccording to the angle θ and length ρ of a line from the origin of theblock to the center of the geometric motion partition line. In someexamples, the definition of the line may be according to the slope m andy-intercept c of the geometric motion partition line, such that motioncompensation unit 72 can calculate a mask indicating to which geometrypartition pixels of the block correspond using fixed point arithmetic.

Motion compensation unit 72 may use motion vectors received in thebitstream to identify a prediction block in reference frames inreference frame store 82. In some examples, the motion vectors may beencoded relative to motion predictors, selected from previously encodedblocks or partitions thereof. Accordingly, motion compensation unit 72may decode the motion vector by determining the motion predictor for theblock or partition, then adding the received difference value to themotion predictor.

Motion compensation unit 72 may also be configured to calculate theprediction values for pixels in a transition region between geometricmotion partitions using a smoothing filter. For example, motioncompensation unit 72 may apply a 3×3 pixel filter to these pixels inorder to determine the prediction values. As another example, motioncompensation unit 72 may calculate the prediction value for a pixel inthe transition region using a weighted sum of the value from the firstpartition and the value from the second partition.

Inverse quantization unit 76 inverse quantizes, that is, de-quantizes,the quantized block coefficients provided in the bitstream and decodedby entropy decoding unit 70. The inverse quantization process mayinclude a conventional process, e.g., as defined by the H.264 decodingstandard. The inverse quantization process may also include use of aquantization parameter QP_(Y) calculated by encoder 50 for eachmacroblock to determine a degree of quantization and, likewise, a degreeof inverse quantization that should be applied.

Inverse transform unit 58 applies an inverse transform, e.g., an inverseDCT, an inverse integer transform, or a conceptually similar inversetransform process, to the transform coefficients in order to produceresidual blocks in the pixel domain. Motion compensation unit 72produces motion compensated blocks, possibly performing interpolationbased on interpolation filters. Identifiers for interpolation filters tobe used for motion estimation with sub-pixel precision may be includedin the syntax elements. Motion compensation unit 72 may useinterpolation filters as used by video encoder 20 during encoding of thevideo block to calculate interpolated values for sub-integer pixels of areference block. Motion compensation unit 72 may determine theinterpolation filters used by video encoder 20 according to receivedsyntax information and use the interpolation filters to producepredictive blocks.

In some examples, inverse transform unit 78 may receive indications oftransform sizes for encoded blocks from motion compensation unit 72.Motion compensation unit 72 may determine whether a block touches ageometric motion partition, and if so, decreases the transform size byone-half, down to a minimum transform size, e.g., 4×4 pixels. In someexamples, the transformed blocks may include syntax information thatdescribes the size of the transform to apply.

Motion compensation unit 72 may use syntax information to determinesizes of macroblocks used to encode frame(s) of the encoded videosequence, partition information that describes how each macroblock of aframe of the encoded video sequence is partitioned, modes indicating howeach partition is encoded, one or more reference frames for eachinter-encoded macroblock or partition, and other information to decodethe encoded video sequence.

Summer 80 sums the residual blocks with the corresponding predictionblocks generated by motion compensation unit 72 or intra-prediction unitto form decoded blocks. If desired, a deblocking filter may also beapplied to filter the decoded blocks in order to remove blockinessartifacts. The decoded video blocks are then stored in reference framestore 82, which provides reference blocks for subsequent motioncompensation and also produces decoded video for presentation on adisplay device (such as display device 32 of FIG. 1).

FIG. 4 is a conceptual diagram illustrating a block 110 that has beenpartitioned using a geometric motion partition line 116. Geometricmotion partition line 116 partitions block 110 into two partitions:region 112 and region 114.

In some examples, geometric motion partition line 116 may be definedaccording to characteristics of perpendicular line 120. In particular,let the intersection of x-axis 113 and y-axis 111 be defined as theorigin for block 110. Perpendicular line 120 is perpendicular togeometric motion partition line 116, and intersects geometric motionpartition line 116 at a point 124. Angle 118 corresponds to the angle ofperpendicular line 120 relative to x-axis 113. Distance 122 correspondsto the distance between the origin of block 110 and point 124 ofgeometric motion partition line 116, which is also the perpendiculardistance of geometric motion partition line 116 from the origin of block110. Angle 118 can also be referred to as θ (theta), while distance 122can also be referred to as ρ (rho), as θ and ρ are defined above. Inthis manner, geometric motion partition line 116 may be defined forblock 110 using the combination of angle 118 and distance 122.

Alternatively, geometric motion partition line 116 may be definedaccording to slope 126 and y-intercept 128. Slope angle 126 correspondsto the slope of geometric motion partition line 116. Y-intercept 128corresponds to the point at which geometric motion partition line 116intersects y-axis 111. Slope 126 may also be expressed using m, whiley-intercept 128 may be expressed using c, as defined above. Slope 126and y-intercept 128 may be expressed as integer values, to permit fixedpoint arithmetic to be used to calculate a mask for block 110 thatindicates whether a pixel is in region 112 or region 114. Slope 126 andy-intercept 128 are mathematically related to angle 118 and distance 120by equation (1) above, reproduced below for convenience:

$\begin{matrix}{y = {{{\frac{- 1}{\tan (\theta)}x} + \frac{\rho}{\sin (\theta)}} = {{mx} + {c.}}}} & (1)\end{matrix}$

FIG. 5 is a conceptual diagram illustrating block 130 that has beenpartitioned using a geometric motion partition line 138. Geometricmotion partition line 138 divides block 130 into two regions: region 132and region 134. Transition region 136 includes pixels near geometricmotion partition line 138. In some examples, transition region 136 maybe defined to include pixels having at least one neighboring pixel inregion 132 and at least one neighboring pixel in region 134. Theneighboring pixels may include any or all of above-neighboring,below-neighboring, left-neighboring, right-neighboring,above-left-neighboring, above-right-neighboring, below-left-neighboring,and/or below-right neighboring.

Pixels in transition region 136 are illustrated with various levels ofshading to indicate whether the pixels are closer to region 132 orregion 134. In particular, lighter-shaded pixels are closer to region132, while darker-shaded pixels are closer to region 134, in thisexample. In one example, a pixel may be said to be closer to aparticular region when a majority of neighboring pixels to the pixel arein the region. In some examples, video encoder 20 and/or video decoder30 may be configured to apply a smoothing filter to pixels in transitionregion 136.

FIG. 6 is a conceptual diagram illustrating a 3×3 pixel array 140. Pixelarray 140 includes a current pixel 142 and neighboring pixels 144A-144H(neighboring pixels 144). In particular, pixel 144B corresponds to anabove-neighboring pixel, pixel 144G corresponds to a below-neighboringpixel, pixel 144D corresponds to a left-neighboring pixel, pixel 144Ecorresponds to a right-neighboring pixel, pixel 144A corresponds to anabove-left-neighboring pixel, pixel 144C corresponds to anabove-right-neighboring pixel, pixel 144F corresponds to abelow-left-neighboring pixel, and pixel 144H corresponds to abelow-right neighboring pixel, in the example of FIG. 6.

Pixel array 140 may be used when determining whether current pixel 142is in a transition region, that is, a region near a geometric motionpartition line. When two or more of neighboring pixels 144 are indifferent regions, current pixel 142 may be said to be included in thetransition region. For example, if neighbor pixel 144D is in region zeroand neighbor pixel 144E is in region one, current pixel 142 may be saidto be in the transition region. In some examples, current pixel 142 maybe said to be closer to a particular region when a majority ofneighboring pixels are in the region. For example, current pixel 142 maybe said to be closer to region zero if neighboring pixels 144A, 144B,144C, 144D, and 144F are in region zero and neighboring pixels 144E,144G, and 144H are in region one.

Pixel array 140 may also be used to define a 3×3 smoothing filter toadjust the value of current pixel 142. The filter may have definedweights for each of current pixel 142 and neighbor pixels 144. Tocalculate a value for current pixel 142, the weights of each of thepixels in pixel array 140 may be multiplied by the values of the pixelsat the corresponding locations, then added and divided by the sum of theweights. In one example, neighbor pixel 144A has a weight of 1, neighborpixel 144B a weight of 2, neighbor pixel 144C a weight of 1, neighborpixel 144D a weight of 2, neighbor pixel 144E a weight of 2, neighborpixel 144F a weight of 1, neighbor pixel 144G a weight of 2, neighborpixel 144H a weight of 1, and current pixel 142 a weight of 3. Theseweights may be multiplied by the value of the respective pixels, andthen divided by 15 (1+2+1+2+3+2+1+2+1) to calculate a smoothed value forcurrent pixel 142.

In another example, neighbor pixel 144A has a weight of 0, neighborpixel 144B a weight of 1, neighbor pixel 144C a weight of 0, neighborpixel 144D a weight of 1, neighbor pixel 144E a weight of 1, neighborpixel 144F a weight of 0, neighbor pixel 144G a weight of 1, neighborpixel 144H a weight of 0, and current pixel 142 a weight of 4. Theseweights may be multiplied by the value of the respective pixels, thendivided by 8 (1+1+4+1+1) to calculate a smoothed value for current pixel142. Other weights may be assigned to neighbor pixels 144 and currentpixel 142 as well, in other examples, to create other smoothing filters.Moreover, the weights assigned to neighboring pixels 144 need notnecessarily be symmetric. Furthermore, larger smoothing filters may alsobe defined, e.g., 5×5, 7×7, etc.

FIG. 7 is a flowchart illustrating an example method for performingsmoothing when calculating a residual value for a block partitioned witha geometric motion partition line. Although described with respect tovideo encoder 20 for purposes of example, it should be understood thatthe method of FIG. 7 may be performed by any other processing unit. Forexample, the method of FIG. 7 may also be applied by video decoder 30.

Initially, video encoder 20 receives a block of video data to be encoded(150). It is assumed for purposes of this example that the blockcorresponds to a block of an inter-prediction encoded frame, e.g., aP-frame or a B-frame. Motion estimation unit 42 may perform a motionsearch for the block. As a result of the motion search, motionestimation unit 42 may determine that the block should be partitionedusing a geometric motion partition line (152). As a result, motionestimation unit 42 may partition the block using a geometric motionpartition line, producing two motion vectors, one for each geometricmotion partition.

Motion estimation unit 42 may send the motion vectors to motioncompensation unit 44, along with a definition of the geometric motionpartition line. The definition of the geometric motion partition linemay be expressed using angle and distance values for a perpendicularline from the origin of the block to the geometric motion partitionline, or using slope and y-intercept values for the geometric motionpartition line, in some examples. Motion compensation unit 44 maycalculate a mask for the block using the definition of the geometricmotion partition line. When the line is defined using the angle andlength of the perpendicular line, the calculation may be made usingfloating point arithmetic. When the line is defined using the slope andy-intercept of the geometric motion partition line, the calculation maybe made using fixed point arithmetic.

Motion compensation unit 44 may determine pixels in the block thatcorrespond to a transition region (154). These pixels may correspond topixels having at least one neighboring pixel in one of the geometricmotion partitions and another neighboring pixel in the other geometricmotion partition. The set of neighboring pixels may include only directneighbors of (e.g., directly above, below, and beside) the pixel, or mayinclude diagonal neighbors to the pixel. Motion compensation unit 44 maythen begin a smoothing process for the pixels in the transition region.

Pixels in the transition region, by definition, include neighbors inboth geometric motion partitions of the block. Thus, smoothing occursbetween the two partitions by calculating prediction values for thepixels in the transition region using values from both partitions of theblock (156). In some examples, smoothing of pixels in the transitionregion occurs by calculating a weighted sum of the values for collocatedpixels in the transition region from each partition.

In some examples, smoothing of pixels in the transition region occurs byaveraging the values of pixels surrounding a pixel in the transitionregion to calculate a prediction value for the pixel in the transitionregion, which includes neighboring pixels in each partition.Accordingly, motion compensation unit 44 may calculate the predictionvalues for the pixels in the transition region by applying a filterhaving assigned weights as coefficients to the pixel to be filtered andneighboring pixels. Motion compensation unit 44 may then average thesevalues by adding each of the values and dividing by the sum of theweights to produce a prediction value for the filtered pixel.

Motion compensation unit 44 may calculate prediction values for each ofthe pixels in the transition region in a similar manner. Then, videoencoder 20 may calculate a residual value for the block by subtractingthe prediction values from the original block (158), e.g., using summer50. As described in greater detail below, video encoder 20 may dividethe residual for the block into sub-blocks of varying sizes to betransformed by transform unit 52. The sizes of the transitions appliedto the sub-blocks may be determined adaptively based on whether thegeometric partition line passes through the partitions. Video encoder 20may also output the calculated residual. Outputting may includetransmitting over a network, broadcasting, storing to a computerreadable medium, or otherwise outputting the data.

The method of FIG. 7 can be summarized as a method includingpartitioning a block of video data into a first partition and a secondpartition using a geometric motion partition line, calculating aprediction value of a pixel in a transition region of the block using afilter that applies a value for at least one neighboring pixel from thefirst partition and a value for at least one neighboring pixel from thesecond partition, calculating a residual value of the pixel in thetransition region of the block based on the prediction value of thepixel in the transition region, and outputting the residual value of thepixel.

A similar method can be performed by video decoder 30. Such a method mayinclude receiving an encoded block of video data, a definition of ageometric motion partition line that partitions the encoded block into afirst partition and a second partition, and a residual value for a pixelin a transition region of the block, calculating a prediction value ofthe pixel in the transition region of the block using a filter thatapplies a value for at least one neighboring pixel from the firstpartition and a value for at least one neighboring pixel from the secondpartition, calculating a reconstructed value for the pixel in thetransition region of the block based on the prediction value and theresidual value, and outputting the reconstructed value of the pixel.

FIG. 8 is a conceptual diagram illustrating an example block 170 to betransformed using adaptive transform size selection. Block 170 has beenpartitioned using geometric motion partition line 172. In the example ofFIG. 8, block 170 is a 16×16 pixel block. Transform unit 52 (FIG. 2) maybe configured with various transforms of different sizes in order totransform sub-blocks of block 170 using different transforms. Videoencoder 20 may first divide block 170 into four 8×8 blocks 174A-174D(8×8 blocks 174), where Tr designates “transform” indicating thetransform size.

For each of the 8×8 blocks 174, video encoder 20 may determine whethergeometric motion partition line 172 passes through the 8×8 block. If so,video encoder 20 may further divide the 8×8 block into a 4×4 block.Otherwise, video encoder 20 may transform the 8×8 block using an 8×8transform.

In the example of FIG. 8, geometric motion partition line 172 passesthrough 8×8 blocks 174B, 174C, and 174D. Therefore, 8×8 blocks 174B,174C, and 174D are further divided into non-overlapping 4×4 blocks.Accordingly, the 4×4 sub-blocks of 8×8 blocks 174B, 174C, and 174D willbe transformed using a 4×4 transform, in this example. Video encoder 20may be configured with a minimum transform size of 4×4, and thus notfurther divide the 4×4 blocks. However, the minimum transform size neednot be 4×4, but may instead by 2×2, or video encoder 20 may not beconfigured with a minimum transform size. In some examples, the minimumtransform size may be larger than 4×4. In this example, geometric motionpartition line 172 does not pass through 8×8 block 174A, and therefore,an 8×8 transform is to be applied to 8×8 block 174A.

FIG. 9 is a conceptual diagram of another example block 180 to betransformed using adaptive transform size selection. In this example,block 180 comprises a 32×32 block that has been partitioned by geometricmotion partition line 182. Initially, video encoder 20 may partitionblock 180 into four 16×16 blocks 184A-184D (16×16 blocks 184). Videoencoder 20 may then determine whether geometric motion partition line182 passes through any of 16×16 bocks 184.

In this example, geometric motion partition line 182 does not passthrough 16×16 block 184A. Therefore, video encoder 20 may transform16×16 partition 184A using a 16×16 partition. Video encoder 20 mayfurther divide 16×16 blocks 184B, 184C, and 184D into 8×8 blocks, asshown in FIG. 9, because geometric motion partition line 182 passesthrough 16×16 blocks 184B, 184C, and 184D. Video encoder 20 may furtherdivide each of the 8×8 blocks through which geometric motion partitionline 182 passes into 4×4 blocks, again as shown in the example of FIG.9. In this example, one 8×8 block of 16×16 block 184B is further dividedinto 4×4 blocks; one 8×8 block of 16×16 block 184C is further dividedinto 4×4 blocks, and three of the 8×8 blocks of 16×16 block 184D arefurther divided into 4×4 blocks. For purposes of example, it is assumedthat video encoder 20 is configured with a minimum transform size of4×4.

Video encoder 20 may transform the undivided 8×8 blocks using an 8×8transform size, and each of the 4×4 blocks using a 4×4 transform size.Video encoder 20 may transform 16×16 block 184A using a 16×16 transform.In this manner, video encoder 20 may adaptively determine a transformsize for sub-blocks of block 180 based on whether the sub-blocks touchgeometric motion partition line 182.

FIG. 10 is a flowchart illustrating an example method for determiningtransform sizes for sub-blocks of an N×N block. Although described withrespect to video encoder 20 for purposes of example, it should beunderstood that the method of FIG. 10 may be performed by any otherprocessing unit. For example, the method of FIG. 10 may also be appliedby video decoder 30 to determine transform sizes for sub-blocks of anN×N block, e.g., to inverse transform the sub-blocks.

Initially, video encoder 20 receives an N×N block (200). The N×N blockmay be a full block that has been partitioned or a sub-block thereof.Video encoder 20 may determine whether a geometric motion partition linepasses through the N×N block (202). If not (“NO” branch of 202), videoencoder 20 may use an N×N transform size to transform the N×N block(204).

On the other hand, if the geometric motion partition line does passthrough the N×N block (“YES” branch of 202), video encoder 20 may dividethe N×N block into four non-overlapping (N/2)×(N/2) blocks (206). Then,video encoder 20 may determine a transform size for each (N/2)×(N/2)block (208). To do so, video encoder 20 may make a recursive call on themethod of FIG. 10 for each (N/2)×(N/2) block. That is, video encoder 20may determine whether the geometric motion partition line passes througheach (N/2)×(N/2) block. For those that it does not, video encoder 20 maytransform using an (N/2)×(N/2) transform size, and for those that itdoes, video encoder 20 may further sub-divide into four (N/4)×(N/4)blocks and determine a transform size for each (N/4)×(N/4) block, againpotentially using a recursive instance of the method of FIG. 10. Videoencoder 20 may then output the transformed sub-blocks. Outputting mayinclude transmitting over a network, broadcasting, storing to a computerreadable medium, or otherwise outputting the data.

An example method similar to the method of FIG. 10 may includepartitioning a block of video data into a first geometric partition anda second geometric partition using a geometric motion partition line,wherein the block comprises N×N pixels, dividing the block of video datainto four equally-sized, non-overlapping (N/2)×(N/2) sub-blocks, andencoding at least one of the sub-blocks through which the geometricmotion partition line passes using a transform size smaller than(N/2)×(N/2).

A similar method may be performed by video decoder 30. An example methodperformed by a video decoder may include receiving an encoded block ofvideo data partitioned into a first geometric partition and a secondgeometric partition by a geometric motion partition line, wherein theblock comprises N×N pixels, dividing the block of video data into fourequally-sized, non-overlapping (N/2)×(N/2) sub-blocks, and inversetransforming at least one of the sub-blocks through which the geometricmotion partition line passes using a transform size smaller than(N/2)×(N/2).

The pseudocode below provides an example function“determineTransformSize” for determining a transform size for a blockwith a starting point at (x, y), as an example partial implementation ofthe method of FIG. 10. The variables slope and intercept are the slopeand intercept values defining a geometric motion partition line for theblock. The variable _minTransform is a global variable defined accordingto the minimum transform size both horizontally and vertically, e.g., 4.The variable currSize is a current transform size, which may initializewith (N/2) for an N×N block that has been geometrically motionpartitioned.

The variable startPartition corresponds to the partition for thestarting pixel of the block at (x, y), while the variable curPartitiontracks the partition for a current pixel of the block. The valuesstartPartition and curPartition are calculated using a c-likeconditional operator “?,” where “condition ? result1: result2” returnsresult1 if “condition” is true, otherwise returns result2. The two forloops iterate through the pixels of the block. If at some point thepartition for a current pixel does not match the partition of thestarting pixel, then the geometric motion partition line passes throughthe block. This causes the for loops to break and a recursive call todetermineTransformSize with the current transform size currSize reducedby one-half. Otherwise, if all pixels of the block remain in the samepartition, the transform size currSize can be used to transform theblock.

int determineTransformSize (int currSize, int x, int y, int slope, intintercept) { if (currSize > _(——)minTransform) { int curPartition = 0;int startPartition = ((y − slope * x) > intercept) ? 0 : 1; for (int i =x; ((i < x+currSize) && (curPartition == startPartition)); i++) for (intj = y; ((j < y+currSize) && (curPartition == startPartition)); j++)curPartition = ((j − slope * i) > intercept) ? 0 : 1; if (curPartition== startPartition) return currSize; else return determineTransformSize(currSize / 2, x, y, slope, intercept); } else return currSize; }

FIG. 11 is a block diagram illustrating a geometry partitioned block 220and neighboring sub-blocks 228A-228F (neighboring sub-blocks 228).Geometric motion partition line 226 divides block 220 into twopartitions: partition 222 and partition 224. A video encoder, such asvideo encoder 20, may encode motion vectors for partitions 222, 224relative to motion vectors for respective ones of neighboring sub-blocks228. That is, video encoder 20 may determine which of neighboringsub-blocks 228 are considered neighbors to each of partitions 222, 224.

Neighbors to partition 222 are not necessarily considered neighbors topartition 224, and likewise, neighbors to partition 224 are notnecessarily considered neighbors to partition 222. For example, videoencoder 20 may determine that each of sub-blocks 228 are neighbors topartition 222, but none of the sub-blocks 228 is neighbors to partition224. For each of sub-blocks 228A and 228E, if the pixels located at itsright border are neighbors of a partition, the sub-block may beconsidered as a neighbor to the partition. For each of sub-blocks 228Band 228F, if the pixels located at its lower border are neighbors of apartition, the sub-block may be considered as a neighbor to thepartition. Sub-block 228D may be considered a neighbor to a partition ifits bottom right corner pixel is a neighbor to the partition. Sub-block228C may be considered a neighbor to a partition if its bottom leftcorner pixel is a neighbor to the partition. In another example, ifpartial border pixels of a sub-block are neighbors, the sub-block may beconsidered to neighbor the partition.

Video encoder 20 may calculate the median of the motion vectors forsub-blocks 228 considered to neighbor a partition in order to determinea motion predictor for the partition. The motion vectors for sub-blocks228 considered to neighbor a partition may also be referred to as a setof candidate motion predictors. Assuming for the purpose of example thateach of sub-blocks 228 are determined to neighbor partition 222, videoencoder 20 may calculate the median of the motion vectors for each ofsub-blocks 228 to determine a motion predictor for partition 222. Videoencoder 20 may then calculate the difference between the motion vectorfor partition 222 and the motion predictor for partition 222 to encodethe motion vector.

Assuming for the purpose of example that sub-blocks 228C, 228E, and 228Fare determined to neighbor partition 224, video encoder 20 may calculatethe median of the motion vectors for sub-blocks 228C, 228E, and 228F todetermine a motion predictor for partition 224. Video encoder 20 maythen calculate the difference between the motion vector for partition224 and the motion predictor for partition 224 to encode the motionvector.

In this manner, a video encoder or video decoder may select a motionpredictor from a larger set of candidate motion predictors thanconventional methods, which select from only sub-blocks 228A, 228B,228C, and 228D. Moreover, a video encoder or video decoder may selectthe motion predictor for one partition, e.g., partition 222,independently of the motion predictor for the other partition, e.g.,partition 224. Thus, the motion predictors for partitions 222, 224 maybe different, although partitions 222, 224 are partitions of the sameblock 220. Accordingly, a video encoder or decoder may select a motionpredictor for a partition based on whether sub-blocks relating tocandidate motion predictors neighbor the partition, rather than theblock containing the partition, that is, the block of which thepartition forms a part.

FIG. 12 is a flowchart illustrating an example method for encodingmotion vectors of geometric motion partitions of a block of video data.Although described with respect to video encoder 20 for purposes ofexample, it should be understood that the method of FIG. 12 may beperformed by any other processing unit. For example, the method of FIG.12 may also be applied by video decoder 30 to decode encoded motionvectors of a block that has been geometrically motion partitioned.

Initially, video encoder 20 may receive a block of video data (250).Video encoder 20 may then partition the block using a geometric motionpartition (252). Video encoder 20 may then determine a set of candidatepredictors for the first geometric motion partition (254). That is,video encoder 20 may determine which of a set of sub-blocks thatneighbor the block are considered to neighbor the first partition aswell. Then, video encoder 20 may retrieve motion vectors for thesub-blocks that neighbor the first partition. Video encoder 20 may thencalculate the median of these motion vectors and use the calculatedmedian as the motion predictor for the first partition (256). Videoencoder 20 may then calculate the difference between the motion vectorfor the first partition and the motion predictor for the first partitionto encode the motion vector relative to the predictor for the firstpartition (258).

Next, video encoder 20 may determine a set of candidate predictors forthe second geometric motion partition (260). That is, video encoder 20may determine which of a set of sub-blocks that neighbor the block areconsidered to neighbor the second partition. Then, video encoder 20 mayretrieve motion vectors for the sub-blocks that neighbor the secondpartition. Video encoder 20 may then calculate the median of thesemotion vectors and use the calculated median as the motion predictor forthe second partition (262). Video encoder 20 may then calculate thedifference between the motion vector for the second partition and themotion predictor for the second partition to encode the motion vectorrelative to the predictor for the second partition (264). Video encoder20 may then output the encoded motion vectors. Outputting may includetransmitting over a network, broadcasting, storing to a computerreadable medium, or otherwise outputting the data.

In this manner, video encoder 20 may encode motion vectors for geometricmotion partitions of a block independently of each other, usingcandidate motion predictors independently selected for each partition.Thus, video encoder 20 may perform a method including partitioning ablock of video data into a first partition and a second partition usinga geometric motion partition line, determining a first motion vector forthe first partition and a second motion vector for the second partition,encoding the first motion vector based on a first motion predictorselected from motion vectors for blocks neighboring the first partition,encoding the second motion vector based on a second motion predictorselected from motion vectors for blocks neighboring the secondpartition, wherein the blocks neighboring the second partition aredetermined independently of the blocks neighboring the first partition,and outputting the encoded first and second motion vectors. Videoencoder 20 may also select the candidate motion predictors from a largerset of motion vectors than conventionally used, as discussed withrespect to FIG. 11.

Video decoder 30 may utilize a similar method to decode an encodedmotion vector for an encoded block. Rather than calculating thedifference between a motion predictor and a motion vector, video decoder30 may receive an encoded motion vector and add the value for theencoded motion vector to the motion predictor to decode the motionvector. Accordingly, video decoder 30 may perform a method includingreceiving a block of video data partitioned by a geometric motionpartition line into a first partition and a second partition, a firstencoded motion vector for the first partition, and a second encodedmotion vector for the second partition, decoding the first encodedmotion vector based on a first motion predictor selected from motionvectors for blocks neighboring the first partition, decoding the secondencoded motion vector based on a second motion predictor selected frommotion vectors for blocks neighboring the second partition, wherein theblocks neighboring the second partition are determined independently ofthe blocks neighboring the first partition, and decoding the block usingthe decoded first and second motion vectors.

FIG. 13 is a flowchart illustrating an example method for encoding ablock of video data using a fixed point implementation. Althoughdescribed with respect to video encoder 20 for purposes of example, itshould be understood that methods similar to that of FIG. 13 may beperformed by other processing units. For example, a method similar tothat of FIG. 13 may also be applied by video decoder 30 to decode videodata in a fixed point implementation.

Initially, video encoder 20 may receive a block of video data (280).Video encoder 20 may then partition the block using a geometric motionpartition (282). Video encoder 20 may define a geometric motionpartition line, used to partition the block, according to an angle θ andlength ρ of a line segment perpendicular to the geometric motionpartition line and starting from the origin of the block.

Video encoder 20 may be configured with step sizes for the angle andlength values, such that the angle and length values can be stored by aninteger having a particular number of bits. As an example, video encoder20 may be configured to store the angle value defining a geometricmotion partition line within a five-bit number. The angle value may havea step size of one and a range between 0 and 31, inclusive. Thus, thedifference between two consecutive steps in the angle value mayrepresent a difference of 11.25 degrees. The length value may depend onthe size of the block, and may correspond to a signed integer having arange of 0 to N/2−1, inclusive, where N represents the block size. Thus,for example, for 16×16 blocks, the length value may correspond to asigned integer between 0 and 7; for 32×32 blocks, the length value maycorrespond to a signed integer between 0 and 15; and for 64×64 blocks,the length value may correspond to a signed integer between 0 and 31.

To allow for a fixed point implementation, however, video encoder 20 maycalculate a slope and y-intercept for the geometric motion partitionline (284), e.g., according to formula (I). Video encoder 20 may expressthe slope and y-intercept as integer values. That is, video encoder 20may calculate the slope and y-intercept values from the angle and lengthvalues, multiply the slope and y-intercept values by an integer value,e.g., 65536, then round the calculated slope and y-intercept values tothe nearest integer. Video encoder 20 may store the resulting slope andy-intercept values as a suitably-sized bit vector, e.g., a 32-bitinteger value.

Video encoder 20 may then calculate a mask for the block using the slopeand y-intercept values (286). That is, video encoder 20 may iteratethrough each point of the block to determine whether the point is inregion 0 or region 1 (e.g., partition 222 or partition 224, in theexample of FIG. 11). Video encoder 20 may refer to the mask whenencoding the block, that is, encode the block based on the mask (288).For example, video encoder 20 may determine the boundaries of eachpartition of the block, in order to calculate a residual for the block.That is, video encoder 20 may refer to the mask to determine whether toretrieve a value for the pixels of the block using the motion vectorassociated with the first partition or the motion vector associated withthe second partition.

Video encoder 20 may retrieve values for the pixels using these motionvectors and calculate a residual for the block by calculating thedifference between these values and the block to be encoded. In thismanner, video encoder 20 may determine whether pixels in the blockcorrespond to the first partition or the second partition using themask, retrieve prediction values for pixels in the first partition froma reference block indicated by a motion vector for the first partition,and retrieve prediction values for pixels in the second partition from areference block indicated by a motion vector for the second partition.

In some examples, video encoder 20 may smooth the transition betweenpartitions using the smoothing techniques described in this disclosure.That is, video encoder 20 may determining a set of pixels of the blockin a transition region, and calculate prediction values for the set ofpixels in the transition region based on the reference block indicatedby the motion vector for the first partition and the reference blockindicated by the motion vector for the second partition.

Video encoder 20 may then output the encoded block, as well as the slopeand y-intercept values that define the geometric motion partition line(290). Outputting may include transmitting over a network, broadcasting,storing to a computer readable medium, or otherwise outputting the data.Video encoder 20 may further encode the motion vectors for thepartitions using the techniques of this disclosure, and may apply theadaptive transform size selection techniques of this disclosure whentransforming the sub-blocks of the residual.

In this manner, an example method corresponding to the method of FIG. 13that may be performed by a video encoder, such as video encoder 20, mayinclude partitioning a block of video data into a first partition and asecond partition using a geometric motion partition line, calculating aslope value and a y-intercept value of the geometric motion partitionline, wherein the slope value and the y-intercept value comprise integervalues, calculating a mask indicative of pixels of the block in thefirst partition and pixels of the block in the second partition,encoding the first partition and the second partition based on the mask,and outputting the encoded first partition, the encoded secondpartition, the slope value, and the y-intercept value.

A video decoder, such as video decoder 30, may perform a similar methodfor decoding video data. An example method of decoding video data mayinclude receiving an encoded block of video data that has beenpartitioned into a first partition and a second partition by a geometricmotion partition line, receiving a slope value and a y-intercept valuedefining the geometric motion partition line, wherein the slope valueand the y-intercept value comprise integer values, calculating a maskindicative of pixels of the block in the first partition and pixels ofthe block in the second partition, decoding the first partition and thesecond partition of the block based on the mask, and outputting thedecoded block.

In one or more examples, the functions described may be implemented inhardware, software, firmware, or any combination thereof. If implementedin software, the functions may be stored on or transmitted over as oneor more instructions or code on a computer-readable medium and executedby a hardware-based processing unit. Computer-readable media may includecomputer-readable storage media, which corresponds to a tangible mediumsuch as data storage media, or communication media including any mediumthat facilitates transfer of a computer program from one place toanother, e.g., according to a communication protocol. In this manner,computer-readable media generally may correspond to (1) tangiblecomputer-readable storage media which is non-transitory or (2) acommunication medium such as a signal or carrier wave. Data storagemedia may be any available media that can be accessed by one or morecomputers or one or more processors to retrieve instructions, codeand/or data structures for implementation of the techniques described inthis disclosure. A computer program product may include acomputer-readable medium.

By way of example, and not limitation, such computer-readable storagemedia can comprise RAM, ROM, EEPROM, CD-ROM or other optical diskstorage, magnetic disk storage, or other magnetic storage devices, flashmemory, or any other medium that can be used to store desired programcode in the form of instructions or data structures and that can beaccessed by a computer. Also, any connection is properly termed acomputer-readable medium. For example, if instructions are transmittedfrom a website, server, or other remote source using a coaxial cable,fiber optic cable, twisted pair, digital subscriber line (DSL), orwireless technologies such as infrared, radio, and microwave, then thecoaxial cable, fiber optic cable, twisted pair, DSL, or wirelesstechnologies such as infrared, radio, and microwave are included in thedefinition of medium. It should be understood, however, thatcomputer-readable storage media and data storage media do not includeconnections, carrier waves, signals, or other transient media, but areinstead directed to non-transient, tangible storage media. Disk anddisc, as used herein, includes compact disc (CD), laser disc, opticaldisc, digital versatile disc (DVD), floppy disk and Blu-Ray disc wheredisks usually reproduce data magnetically, while discs reproduce dataoptically with lasers. Combinations of the above should also be includedwithin the scope of computer-readable media.

Instructions may be executed by one or more processors, such as one ormore digital signal processors (DSPs), general purpose microprocessors,application specific integrated circuits (ASICs), field programmablelogic arrays (FPGAs), or other equivalent integrated or discrete logiccircuitry. Accordingly, the term “processor,” as used herein may referto any of the foregoing structure or any other structure suitable forimplementation of the techniques described herein. In addition, in someaspects, the functionality described herein may be provided withindedicated hardware and/or software modules configured for encoding anddecoding, or incorporated in a combined codec. Also, the techniquescould be fully implemented in one or more circuits or logic elements.

The techniques of this disclosure may be implemented in a wide varietyof devices or apparatuses, including a wireless handset, an integratedcircuit (IC) or a set of ICs (e.g., a chip set). Various components,modules, or units are described in this disclosure to emphasizefunctional aspects of devices configured to perform the disclosedtechniques, but do not necessarily require realization by differenthardware units. Rather, as described above, various units may becombined in a codec hardware unit or provided by a collection ofinteroperative hardware units, including one or more processors asdescribed above, in conjunction with suitable software and/or firmware.

Various examples have been described. These and other examples arewithin the scope of the following claims.

1. A method of encoding video data, the method comprising: partitioninga block of video data into a first partition and a second partitionusing a geometric motion partition line; determining a first motionvector for the first partition and a second motion vector for the secondpartition; encoding the first motion vector based on a first motionpredictor selected from motion vectors for blocks neighboring the firstpartition; encoding the second motion vector based on a second motionpredictor selected from motion vectors for blocks neighboring the secondpartition, wherein the blocks neighboring the second partition aredetermined independently of the blocks neighboring the first partition;and outputting the encoded first and second motion vectors.
 2. Themethod of claim 1, further comprising: determining a set of blocks thatneighbor the partitioned block; determining a first subset of the set ofblocks comprising blocks that neighbor the first partition; anddetermining a second subset of the set of blocks comprising blocks thatneighbor the second partition, independently of determining the firstsubset.
 3. The method of claim 2, further comprising: determining thefirst motion predictor by calculating the median of motion vectors forblocks of the first subset; and determining the second motion predictorby calculating the median of motion vectors for blocks of the secondsubset.
 4. The method of claim 2, wherein the set of blocks thatneighbor the partitioned block comprises more than four blocks.
 5. Themethod of claim 2, wherein the set of blocks that neighbor thepartitioned block comprise blocks above the partitioned block and blocksto the left of the partitioned block.
 6. The method of claim 2, whereinthe set of blocks that neighbor the partitioned block comprises at leastone of sub-blocks of a block to the left of the partitioned block andsub-blocks of a block above the partitioned block.
 7. An apparatus forencoding video data, the apparatus comprising a video encoder configuredto partition a block of video data into a first partition and a secondpartition using a geometric motion partition line, determine a firstmotion vector for the first partition and a second motion vector for thesecond partition, encode the first motion vector based on a first motionpredictor selected from motion vectors for blocks neighboring the firstpartition, encode the second motion vector based on a second motionpredictor selected from motion vectors for blocks neighboring the secondpartition, wherein the blocks neighboring the second partition aredetermined independently of the blocks neighboring the first partition,and output the encoded first and second motion vectors.
 8. The apparatusof claim 7, wherein the video encoder is configured to determine a setof blocks that neighbor the partitioned block, determine a first subsetof the set of blocks comprising blocks that neighbor the firstpartition, and determine a second subset of the set of blocks comprisingblocks that neighbor the second partition, independently of determiningthe first subset.
 9. The apparatus of claim 8, wherein the video encoderis configured to determine the first motion predictor by calculating themedian of motion vectors for blocks of the first subset, and todetermine the second motion predictor by calculating the median ofmotion vectors for blocks of the second subset.
 10. The apparatus ofclaim 8, wherein the set of blocks that neighbor the partitioned blockcomprises more than four blocks.
 11. The apparatus of claim 8, whereinthe set of blocks that neighbor the partitioned block comprise blocksabove the partitioned block and blocks to the left of the partitionedblock.
 12. The apparatus of claim 8, wherein the set of blocks thatneighbor the partitioned block comprises at least one of sub-blocks of ablock to the left of the partitioned block and sub-blocks of a blockabove the partitioned block.
 13. An apparatus for encoding video data,the apparatus comprising: means for partitioning a block of video datainto a first partition and a second partition using a geometric motionpartition line; means for determining a first motion vector for thefirst partition and a second motion vector for the second partition;means for encoding the first motion vector based on a first motionpredictor selected from motion vectors for blocks neighboring the firstpartition; means for encoding the second motion vector based on a secondmotion predictor selected from motion vectors for blocks neighboring thesecond partition, wherein the blocks neighboring the second partitionare determined independently of the blocks neighboring the firstpartition; and means for outputting the encoded first and second motionvectors.
 14. The apparatus of claim 13, further comprising: means fordetermining a set of blocks that neighbor the partitioned block; meansfor determining a first subset of the set of blocks comprising blocksthat neighbor the first partition; and means for determining a secondsubset of the set of blocks comprising blocks that neighbor the secondpartition, independently of determining the first subset.
 15. Theapparatus of claim 14, further comprising: means for determining thefirst motion predictor by calculating the median of motion vectors forblocks of the first subset; and means for determining the second motionpredictor by calculating the median of motion vectors for blocks of thesecond subset.
 16. The apparatus of claim 14, wherein the set of blocksthat neighbor the partitioned block comprises more than four blocks. 17.The apparatus of claim 14, wherein the set of blocks that neighbor thepartitioned block comprise blocks above the partitioned block and blocksto the left of the partitioned block.
 18. The apparatus of claim 14,wherein the set of blocks that neighbor the partitioned block comprisesat least one of sub-blocks of a block to the left of the partitionedblock and sub-blocks of a block above the partitioned block.
 19. Acomputer program product comprising a computer-readable storage mediumhaving stored thereon instructions that, when executed, cause aprocessor to: partition a block of video data into a first partition anda second partition using a geometric motion partition line; determine afirst motion vector for the first partition and a second motion vectorfor the second partition; encode the first motion vector based on afirst motion predictor selected from motion vectors for blocksneighboring the first partition; encode the second motion vector basedon a second motion predictor selected from motion vectors for blocksneighboring the second partition, wherein the blocks neighboring thesecond partition are determined independently of the blocks neighboringthe first partition; and output the encoded first and second motionvectors.
 20. The computer program product of claim 19, furthercomprising instructions that cause the processor to: determine a set ofblocks that neighbor the partitioned block; determine a first subset ofthe set of blocks comprising blocks that neighbor the first partition;and determine a second subset of the set of blocks comprising blocksthat neighbor the second partition, independently of determining thefirst subset.
 21. The computer program product of claim 20, furthercomprising instructions that cause the processor to: determining thefirst motion predictor by calculating the median of motion vectors forblocks of the first subset; and determining the second motion predictorby calculating the median of motion vectors for blocks of the secondsubset.
 22. The computer program product of claim 20, wherein the set ofblocks that neighbor the partitioned block comprises more than fourblocks.
 23. The computer program product of claim 20, wherein the set ofblocks that neighbor the partitioned block comprise blocks above thepartitioned block and blocks to the left of the partitioned block. 24.The computer program product of claim 20, wherein the set of blocks thatneighbor the partitioned block comprises at least one of sub-blocks of ablock to the left of the partitioned block and sub-blocks of a blockabove the partitioned block.
 25. A method of decoding video data, themethod comprising: receiving a block of video data partitioned by ageometric motion partition line into a first partition and a secondpartition, a first encoded motion vector for the first partition, and asecond encoded motion vector for the second partition; decoding thefirst encoded motion vector based on a first motion predictor selectedfrom motion vectors for blocks neighboring the first partition; decodingthe second encoded motion vector based on a second motion predictorselected from motion vectors for blocks neighboring the secondpartition, wherein the blocks neighboring the second partition aredetermined independently of the blocks neighboring the first partition;and decoding the block using the decoded first and second motionvectors.
 26. The method of claim 25, further comprising: determining aset of blocks that neighbor the partitioned block; determining a firstsubset of the set of blocks comprising blocks that neighbor the firstpartition; and determining a second subset of the set of blockscomprising blocks that neighbor the second partition, independently ofdetermining the first subset.
 27. The method of claim 26, furthercomprising: determining the first motion predictor by calculating themedian of motion vectors for blocks of the first subset; and determiningthe second motion predictor by calculating the median of motion vectorsfor blocks of the second subset.
 28. The method of claim 26, wherein theset of blocks that neighbor the partitioned block comprises more thanfour blocks.
 29. The method of claim 26, wherein the set of blocks thatneighbor the partitioned block comprise blocks above the partitionedblock and blocks to the left of the partitioned block.
 30. The method ofclaim 26, wherein the set of blocks that neighbor the partitioned blockcomprises at least one of sub-blocks of a block to the left of thepartitioned block and sub-blocks of a block above the partitioned block.31. An apparatus for decoding video data, the apparatus comprising avideo decoder configured to receive a block of video data partitioned bya geometric motion partition line into a first partition and a secondpartition, a first encoded motion vector for the first partition, and asecond encoded motion vector for the second partition, decode the firstencoded motion vector based on a first motion predictor selected frommotion vectors for blocks neighboring the first partition, decode thesecond encoded motion vector based on a second motion predictor selectedfrom motion vectors for blocks neighboring the second partition, whereinthe blocks neighboring the second partition are determined independentlyof the blocks neighboring the first partition, and decode the blockusing the decoded first and second motion vectors.
 32. The apparatus ofclaim 31, wherein the video decoder is configured to determine a set ofblocks that neighbor the partitioned block, determine a first subset ofthe set of blocks comprising blocks that neighbor the first partition,and determine a second subset of the set of blocks comprising blocksthat neighbor the second partition, independently of determining thefirst subset.
 33. The apparatus of claim 32, wherein the video decoderis configured to determine the first motion predictor by calculating themedian of motion vectors for blocks of the first subset, and todetermine the second motion predictor by calculating the median ofmotion vectors for blocks of the second subset.
 34. The apparatus ofclaim 32, wherein the set of blocks that neighbor the partitioned blockcomprises more than four blocks.
 35. The apparatus of claim 32, whereinthe set of blocks that neighbor the partitioned block comprise blocksabove the partitioned block and blocks to the left of the partitionedblock.
 36. The apparatus of claim 32, wherein the set of blocks thatneighbor the partitioned block comprises at least one of sub-blocks of ablock to the left of the partitioned block and sub-blocks of a blockabove the partitioned block.
 37. An apparatus for decoding video data,the apparatus comprising: means for receiving a block of video datapartitioned by a geometric motion partition line into a first partitionand a second partition, a first encoded motion vector for the firstpartition, and a second encoded motion vector for the second partition;means for decoding the first encoded motion vector based on a firstmotion predictor selected from motion vectors for blocks neighboring thefirst partition; means for decoding the second encoded motion vectorbased on a second motion predictor selected from motion vectors forblocks neighboring the second partition, wherein the blocks neighboringthe second partition are determined independently of the blocksneighboring the first partition; and means for decoding the block usingthe decoded first and second motion vectors.
 38. The apparatus of claim37, further comprising: means for determining a set of blocks thatneighbor the partitioned block; means for determining a first subset ofthe set of blocks comprising blocks that neighbor the first partition;and means for determining a second subset of the set of blockscomprising blocks that neighbor the second partition, independently ofdetermining the first subset.
 39. The apparatus of claim 38, furthercomprising: means for determining the first motion predictor bycalculating the median of motion vectors for blocks of the first subset;and means for determining the second motion predictor by calculating themedian of motion vectors for blocks of the second subset.
 40. Theapparatus of claim 38, wherein the set of blocks that neighbor thepartitioned block comprises more than four blocks.
 41. The apparatus ofclaim 38, wherein the set of blocks that neighbor the partitioned blockcomprise blocks above the partitioned block and blocks to the left ofthe partitioned block.
 42. The apparatus of claim 38, wherein the set ofblocks that neighbor the partitioned block comprises at least one ofsub-blocks of a block to the left of the partitioned block andsub-blocks of a block above the partitioned block.
 43. A computerprogram product comprising a computer-readable storage medium havingstored thereon instructions that, when executed, cause a processor to:receive a block of video data partitioned by a geometric motionpartition line into a first partition and a second partition, a firstencoded motion vector for the first partition, and a second encodedmotion vector for the second partition; decode the first encoded motionvector based on a first motion predictor selected from motion vectorsfor blocks neighboring the first partition; decode the second encodedmotion vector based on a second motion predictor selected from motionvectors for blocks neighboring the second partition, wherein the blocksneighboring the second partition are determined independently of theblocks neighboring the first partition; and decode the block using thedecoded first and second motion vectors.
 44. The computer programproduct of claim 43, further comprising instructions that cause theprocessor to: determine a set of blocks that neighbor the partitionedblock; determine a first subset of the set of blocks comprising blocksthat neighbor the first partition; and determine a second subset of theset of blocks comprising blocks that neighbor the second partition,independently of determining the first subset.
 45. The computer programproduct of claim 44, further comprising instructions that cause theprocessor to: determining the first motion predictor by calculating themedian of motion vectors for blocks of the first subset; and determiningthe second motion predictor by calculating the median of motion vectorsfor blocks of the second subset.
 46. The computer program product ofclaim 44, wherein the set of blocks that neighbor the partitioned blockcomprises more than four blocks.
 47. The computer program product ofclaim 44, wherein the set of blocks that neighbor the partitioned blockcomprise blocks above the partitioned block and blocks to the left ofthe partitioned block.
 48. The computer program product of claim 44,wherein the set of blocks that neighbor the partitioned block comprisesat least one of sub-blocks of a block to the left of the partitionedblock and sub-blocks of a block above the partitioned block.